Package org.bouncycastle.jcajce
Class CompositePublicKey
- java.lang.Object
-
- org.bouncycastle.jcajce.CompositePublicKey
-
- All Implemented Interfaces:
java.io.Serializable,java.security.Key,java.security.PublicKey
public class CompositePublicKey extends java.lang.Object implements java.security.PublicKeyA composite key class.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCompositePublicKey.Builder
-
Constructor Summary
Constructors Constructor Description CompositePublicKey(java.security.PublicKey... keys)Create a composite public key from an array of PublicKeys.CompositePublicKey(ASN1ObjectIdentifier algorithmIdentifier, java.security.PublicKey... keys)CompositePublicKey(AlgorithmIdentifier algorithmIdentifier, java.security.PublicKey... keys)Create a composite public key which corresponds to a composite signature algorithm in algorithmIdentifier.CompositePublicKey(SubjectPublicKeyInfo keyInfo)Create a composite public key from a SubjectPublicKeyInfo.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CompositePublicKey.Builderbuilder(java.lang.String algorithmName)static CompositePublicKey.Builderbuilder(ASN1ObjectIdentifier compAlgOid)booleanequals(java.lang.Object obj)java.lang.StringgetAlgorithm()AlgorithmIdentifiergetAlgorithmIdentifier()byte[]getEncoded()Returns the composite public key encoded as a SubjectPublicKeyInfo.java.lang.StringgetFormat()java.util.List<java.security.Provider>getProviders()Return a list of the providers supporting the component private keys.java.util.List<java.security.PublicKey>getPublicKeys()Return a list of the component public keys making up this composite.inthashCode()
-
-
-
Constructor Detail
-
CompositePublicKey
public CompositePublicKey(java.security.PublicKey... keys)
Create a composite public key from an array of PublicKeys. This constructor is currently used only for legacy composites implementation.- Parameters:
keys- The component public keys.
-
CompositePublicKey
public CompositePublicKey(ASN1ObjectIdentifier algorithmIdentifier, java.security.PublicKey... keys)
-
CompositePublicKey
public CompositePublicKey(AlgorithmIdentifier algorithmIdentifier, java.security.PublicKey... keys)
Create a composite public key which corresponds to a composite signature algorithm in algorithmIdentifier. The component public keys are not checked if they satisfy the composite definition at this point, however, they will fail when they are fed into component algorithms which are defined by the algorithmIdentifier.- Parameters:
algorithmIdentifier-keys-
-
CompositePublicKey
public CompositePublicKey(SubjectPublicKeyInfo keyInfo)
Create a composite public key from a SubjectPublicKeyInfo.- Parameters:
keyInfo- SubjectPublicKeyInfo object containing a composite public key.
-
-
Method Detail
-
builder
public static CompositePublicKey.Builder builder(ASN1ObjectIdentifier compAlgOid)
-
builder
public static CompositePublicKey.Builder builder(java.lang.String algorithmName)
-
getPublicKeys
public java.util.List<java.security.PublicKey> getPublicKeys()
Return a list of the component public keys making up this composite.- Returns:
- an immutable list of public 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:
getAlgorithmin interfacejava.security.Key
-
getAlgorithmIdentifier
public AlgorithmIdentifier getAlgorithmIdentifier()
-
getFormat
public java.lang.String getFormat()
- Specified by:
getFormatin interfacejava.security.Key
-
getEncoded
public byte[] getEncoded()
Returns the composite public key encoded as a SubjectPublicKeyInfo. If the composite public key is legacy (MiscObjectIdentifiers.id_composite_key), it each component public key is wrapped in its own SubjectPublicKeyInfo. Other composite public keys are encoded according to Composite ML-DSA for use in X.509 Public Key Infrastructure where each component public key is a BIT STRING which contains the result of calling getEncoded() for each component public key.- Specified by:
getEncodedin interfacejava.security.Key- Returns:
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-