Package tahrir.tools.ByteArraySegment

Examples of tahrir.tools.ByteArraySegment.ByteArraySegmentBuilder.build()


    final ByteArraySegmentBuilder dos = ByteArraySegment.builder();
    try {
      TrSerializer.serializeTo(plainText, dos);
      dos.flush();
      final TrSymKey aesKey = createAesKey();
      final ByteArraySegment aesEncrypted = aesKey.encrypt(dos.build());
      final Cipher cipher = getRSACipher();
      cipher.init(Cipher.ENCRYPT_MODE, pubKey);
      final byte[] rsaEncryptedAesKey = cipher.doFinal(aesKey.toBytes());
      return new TrPPKEncrypted<T>(rsaEncryptedAesKey, aesEncrypted);
    } catch (final Exception e) {
View Full Code Here


              if (!s.get())
                return;
            }
            sentListener.sent();
          }
        }, encryptOutbound(builder.build()), this, priority);
        resenders.put(messageId, resender);
        resender.run();
      } catch (final TrSerializableException 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
Copyright © 2018 www.massapi.com. 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.