Package tahrir.tools

Examples of tahrir.tools.ByteArraySegment$ByteArraySegmentBuilder


  public static ByteArraySegment decryptRaw(final ByteArraySegment cipherText, final RSAPrivateKey privKey) {
    final Cipher cipher = getRSACipher();
    try {
      cipher.init(Cipher.DECRYPT_MODE, privKey);
      return new ByteArraySegment(cipher.doFinal(cipherText.array, cipherText.offset, cipherText.length));
    } catch (final Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here


  public static <T> T decrypt(final Class<T> c, final TrPPKEncrypted<T> cipherText, final RSAPrivateKey privKey) {
    final Cipher cipher = getRSACipher();
    try {
      cipher.init(Cipher.DECRYPT_MODE, privKey);
      final TrSymKey aesKey = new TrSymKey(new ByteArraySegment(cipher.doFinal(cipherText.rsaEncryptedAesKey)));
      final ByteArraySegment serializedPlainTextByteArray = aesKey.decrypt(cipherText.aesCypherText);
      final DataInputStream dis = serializedPlainTextByteArray.toDataInputStream();
      return TrSerializer.deserializeFrom(c, dis);
    } catch (final Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

      if (priority == null)
        throw new RuntimeException("Required @Priority annotation missing on method " + method
            + " in interface "
            + method.getDeclaringClass());

      final ByteArraySegment messageBAS = builder.build();

      connection.send(messageBAS, priority.value(), new TrSentReceivedListener() {

        public void sent() {
View Full Code Here

TOP

Related Classes of tahrir.tools.ByteArraySegment$ByteArraySegmentBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.