Class ECDH1PUCryptoProvider

    • Field Detail

      • SUPPORTED_ALGORITHMS

        public static final java.util.Set<JWEAlgorithm> SUPPORTED_ALGORITHMS
        The supported JWE algorithms by the ECDH crypto provider class.
      • SUPPORTED_ENCRYPTION_METHODS

        public static final java.util.Set<EncryptionMethod> SUPPORTED_ENCRYPTION_METHODS
        The supported encryption methods by the ECDH crypto provider class.
    • Constructor Detail

      • ECDH1PUCryptoProvider

        protected ECDH1PUCryptoProvider​(Curve curve)
                                 throws JOSEException
        Creates a new Elliptic Curve Diffie-Hellman One-Pass Unified Model encryption / decryption provider.
        Parameters:
        curve - The elliptic curve. Must be supported and not null.
        Throws:
        JOSEException - If the elliptic curve is not supported.
    • Method Detail

      • getConcatKDF

        protected ConcatKDF getConcatKDF()
        Returns the Concatenation Key Derivation Function (KDF).
        Returns:
        The concat KDF.
      • supportedEllipticCurves

        public abstract java.util.Set<Curve> supportedEllipticCurves()
        Returns the names of the supported elliptic curves. These correspond to the crv JWK parameter.
        Returns:
        The supported elliptic curves.
      • getCurve

        public Curve getCurve()
        Returns the elliptic curve of the key (JWK designation).
        Returns:
        The elliptic curve.
      • encryptWithZ

        protected JWECryptoParts encryptWithZ​(JWEHeader header,
                                              javax.crypto.SecretKey Z,
                                              byte[] clearText,
                                              javax.crypto.SecretKey contentEncryptionKey)
                                       throws JOSEException
        Encrypts the specified plaintext using the specified shared secret ("Z"), with an optionally externally supplied content encryption key (CEK) for ECDH.AlgorithmMode.KW.
        Throws:
        JOSEException
      • supportedJWEAlgorithms

        public java.util.Set<JWEAlgorithm> supportedJWEAlgorithms()
        Description copied from interface: JWEProvider
        Returns the names of the supported algorithms by the JWE provider instance. These correspond to the alg JWE header parameter.
        Specified by:
        supportedJWEAlgorithms in interface JWEProvider
        Returns:
        The supported JWE algorithms, empty set if none.
      • supportedEncryptionMethods

        public java.util.Set<EncryptionMethod> supportedEncryptionMethods()
        Description copied from interface: JWEProvider
        Returns the names of the supported encryption methods by the JWE provier. These correspond to the enc JWE header parameter.
        Specified by:
        supportedEncryptionMethods in interface JWEProvider
        Returns:
        The supported encryption methods, empty set if none.
      • getJCAContext

        public JWEJCAContext getJCAContext()
        Description copied from interface: JCAAware
        Returns the Java Cryptography Architecture (JCA) context. May be used to set a specific JCA security provider or secure random generator.
        Specified by:
        getJCAContext in interface JCAAware<JWEJCAContext>
        Returns:
        The JCA context. Not null.