Class CompositePrivateKey

  • All Implemented Interfaces:
    java.io.Serializable, java.security.Key, java.security.PrivateKey, javax.security.auth.Destroyable

    public class CompositePrivateKey
    extends java.lang.Object
    implements java.security.PrivateKey
    A composite private key class for Composite ML-KEM.
    See Also:
    Serialized Form
    • Constructor Detail

      • CompositePrivateKey

        public CompositePrivateKey​(java.security.PrivateKey... keys)
        Create a composite private key from an array of PrivateKeys.
        Parameters:
        keys - The component private keys.
      • CompositePrivateKey

        public CompositePrivateKey​(ASN1ObjectIdentifier algorithm,
                                   java.security.PrivateKey... keys)
      • CompositePrivateKey

        public CompositePrivateKey​(AlgorithmIdentifier algorithmIdentifier,
                                   java.security.PrivateKey... keys)
        Create a composite private key which corresponds to a composite KEM algorithm in algorithmIdentifier.
        Parameters:
        algorithmIdentifier -
        keys -
      • CompositePrivateKey

        public CompositePrivateKey​(PrivateKeyInfo keyInfo)
        Create a composite private key from a PrivateKeyInfo.
        Parameters:
        keyInfo - PrivateKeyInfo object containing a composite private key.
    • Method Detail

      • getPrivateKeys

        public java.util.List<java.security.PrivateKey> getPrivateKeys()
        Return a list of the component private keys making up this composite.
        Returns:
        an immutable list of private keys.
      • getProviders

        public java.util.List<java.security.Provider> getProviders()
        Return a list of the providers supporting the component private keys.
        Returns:
        an immutable list of Provider objects.
      • getAlgorithm

        public java.lang.String getAlgorithm()
        Specified by:
        getAlgorithm in interface java.security.Key
      • getFormat

        public java.lang.String getFormat()
        Specified by:
        getFormat in interface java.security.Key
      • getEncoded

        public byte[] getEncoded()
        Returns the encoding of the composite private key as per Section 4.2. Format: ML-KEM seed (64 bytes) || Traditional private key encoding
        Specified by:
        getEncoded in interface java.security.Key
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object