Class LegacyFullHybridEncrypt

  • All Implemented Interfaces:
    HybridEncrypt

    @Immutable
    public final class LegacyFullHybridEncrypt
    extends java.lang.Object
    implements HybridEncrypt
    Takes an arbitrary raw HybridEncrypt and makes it a full primitive. This is a class that helps us transition onto the new Keys and Configurations interface, by bringing potential user-defined primitives to a common denominator with our primitives over which we have control.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static HybridEncrypt create​(LegacyProtoKey key)
      This method covers the cases where users created their own aead/key classes.
      byte[] encrypt​(byte[] plaintext, byte[] contextInfo)
      Encryption operation: encrypts plaintext binding contextInfo to the resulting ciphertext.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • create

        public static HybridEncrypt create​(LegacyProtoKey key)
                                    throws java.security.GeneralSecurityException
        This method covers the cases where users created their own aead/key classes.
        Throws:
        java.security.GeneralSecurityException
      • encrypt

        public byte[] encrypt​(byte[] plaintext,
                              byte[] contextInfo)
                       throws java.security.GeneralSecurityException
        Description copied from interface: HybridEncrypt
        Encryption operation: encrypts plaintext binding contextInfo to the resulting ciphertext.
        Specified by:
        encrypt in interface HybridEncrypt
        Returns:
        resulting ciphertext
        Throws:
        java.security.GeneralSecurityException