Class CompositePrivateKey

java.lang.Object
org.bouncycastle.jcajce.CompositePrivateKey
All Implemented Interfaces:
Serializable, Key, PrivateKey, Destroyable

public class CompositePrivateKey extends Object implements PrivateKey
A composite private key class.
See Also:
  • Constructor Details

    • CompositePrivateKey

      public CompositePrivateKey(PrivateKey... keys)
      Create a composite private key from an array of PublicKeys. This constructor is currently used only for legacy composites implementation.
      Parameters:
      keys - The component private keys.
    • CompositePrivateKey

      public CompositePrivateKey(ASN1ObjectIdentifier algorithmIdentifier, PrivateKey... keys)
      Create a composite private key which corresponds to a composite signature algorithm in algorithmIdentifier. The component private 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 -
    • CompositePrivateKey

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

    • getPrivateKeys

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

      public String getAlgorithm()
      Specified by:
      getAlgorithm in interface Key
    • getAlgorithmIdentifier

      public ASN1ObjectIdentifier getAlgorithmIdentifier()
    • getFormat

      public String getFormat()
      Specified by:
      getFormat in interface Key
    • getEncoded

      public byte[] getEncoded()
      Returns the encoding of the composite private key. It is compliant with https://www.ietf.org/archive/id/draft-ounsworth-pq-composite-sigs-13.html#name-compositesignatureprivateke as each component is encoded as a PrivateKeyInfo (older name for OneAsymmetricKey).
      Specified by:
      getEncoded in interface Key
      Returns:
    • hashCode

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object