Class HpkeEncrypt

  • All Implemented Interfaces:
    HybridEncrypt

    @Immutable
    public final class HpkeEncrypt
    extends java.lang.Object
    implements HybridEncrypt
    Hybrid Public Key Encryption (HPKE) encryption.

    HPKE RFC: https://www.rfc-editor.org/rfc/rfc9180.html

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static HybridEncrypt create​(HpkePublicKey key)  
      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​(HpkePublicKey key)
                                    throws java.security.GeneralSecurityException
        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