Class KeyFactorySpi

    • Constructor Detail

      • KeyFactorySpi

        public KeyFactorySpi()
      • KeyFactorySpi

        public KeyFactorySpi​(JcaJceHelper helper)
    • Method Detail

      • engineTranslateKey

        protected java.security.Key engineTranslateKey​(java.security.Key key)
                                                throws java.security.InvalidKeyException
        Specified by:
        engineTranslateKey in class java.security.KeyFactorySpi
        Throws:
        java.security.InvalidKeyException
      • generatePrivate

        public java.security.PrivateKey generatePrivate​(PrivateKeyInfo keyInfo)
                                                 throws java.io.IOException
        Creates a CompositePrivateKey from its PrivateKeyInfo encoded form. Per draft-ietf-lamps-pq-composite-kem the private key body is the 64-byte ML-KEM seed concatenated with the traditional private key encoding; the two components are split and decoded with their respective component key factories.
        Specified by:
        generatePrivate in interface AsymmetricKeyInfoConverter
        Parameters:
        keyInfo - PrivateKeyInfo whose key body is the concatenation of the two component keys.
        Returns:
        A CompositePrivateKey holding both component private keys.
        Throws:
        java.io.IOException - on a malformed encoding.
      • generatePublic

        public java.security.PublicKey generatePublic​(SubjectPublicKeyInfo keyInfo)
                                               throws java.io.IOException
        Creates a CompositePublicKey from its SubjectPublicKeyInfo encoded form. Per draft-ietf-lamps-pq-composite-kem the public key is the concatenation of the two raw component public keys; it is split at the fixed ML-KEM public key size and each component is decoded with its key factory.
        Specified by:
        generatePublic in interface AsymmetricKeyInfoConverter
        Parameters:
        keyInfo - SubjectPublicKeyInfo whose key body is the concatenation of the two component public keys.
        Returns:
        A CompositePublicKey holding both component public keys.
        Throws:
        java.io.IOException - on a malformed encoding.