Class CompositePrivateKey
java.lang.Object
org.bouncycastle.jcajce.CompositePrivateKey
- All Implemented Interfaces:
Serializable, AsymmetricKey, DEREncodablePREVIEW, Key, PrivateKey, Destroyable
A composite private key class for Composite ML-KEM.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface PrivateKey
serialVersionUID -
Constructor Summary
ConstructorsConstructorDescriptionCompositePrivateKey(PrivateKey... keys) Create a composite private key from an array of PrivateKeys.CompositePrivateKey(ASN1ObjectIdentifier algorithm, PrivateKey... keys) CompositePrivateKey(PrivateKeyInfo keyInfo) Create a composite private key from a PrivateKeyInfo.CompositePrivateKey(AlgorithmIdentifier algorithmIdentifier, PrivateKey... keys) Create a composite private key which corresponds to a composite KEM algorithm in algorithmIdentifier. -
Method Summary
Modifier and TypeMethodDescriptionstatic CompositePrivateKey.Builderstatic CompositePrivateKey.Builderbuilder(ASN1ObjectIdentifier compAlgOid) booleanReturn the name the composite algorithm this key belongs to is registered under, or null if the key's algorithm is not one of the composite signature or composite KEM parameter sets (the legacy generic composite key OIDs have no registered name of their own).byte[]Returns the encoding of the composite private key as per Section 4.2.Return a list of the component private keys making up this composite.Return a list of the providers supporting the component private keys.inthashCode()Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AsymmetricKey
getParamsMethods inherited from interface Destroyable
destroy, isDestroyed
-
Constructor Details
-
CompositePrivateKey
Create a composite private key from an array of PrivateKeys.- Parameters:
keys- The component private keys.
-
CompositePrivateKey
-
CompositePrivateKey
Create a composite private key which corresponds to a composite KEM algorithm in algorithmIdentifier.- Parameters:
algorithmIdentifier-keys-
-
CompositePrivateKey
Create a composite private key from a PrivateKeyInfo.- Parameters:
keyInfo- PrivateKeyInfo object containing a composite private key.
-
-
Method Details
-
builder
-
builder
-
getPrivateKeys
Return a list of the component private keys making up this composite.- Returns:
- an immutable list of private keys.
-
getProviders
-
getAlgorithm
Return the name the composite algorithm this key belongs to is registered under, or null if the key's algorithm is not one of the composite signature or composite KEM parameter sets (the legacy generic composite key OIDs have no registered name of their own).- Specified by:
getAlgorithmin interfaceKey- Returns:
- the composite algorithm name, e.g. "MLDSA44-Ed25519-SHA512" or "MLKEM768-X25519-SHA3-256".
-
getAlgorithmIdentifier
-
getFormat
-
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:
getEncodedin interfaceKey
-
hashCode
-
equals
-