java.lang.Object
java.security.KeyFactorySpi
org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi
org.bouncycastle.jcajce.provider.asymmetric.compositesignatures.KeyFactorySpi
All Implemented Interfaces:
AsymmetricKeyInfoConverter

public class KeyFactorySpi extends BaseKeyFactorySpi
KeyFactory for composite signatures. List of supported combinations is in CompositeSignaturesConstants
  • Constructor Details

    • KeyFactorySpi

      public KeyFactorySpi()
  • Method Details

    • engineTranslateKey

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

      public PrivateKey generatePrivate(PrivateKeyInfo keyInfo) throws IOException
      Creates a CompositePrivateKey from its PrivateKeyInfo encoded form. It is compliant with https://www.ietf.org/archive/id/draft-ounsworth-pq-composite-sigs-13.html where CompositeSignaturePrivateKey is a sequence of two OneAsymmetricKey which a newer name for PrivateKeyInfo.
      Parameters:
      keyInfo - PrivateKeyInfo containing a sequence of PrivateKeyInfos corresponding to each component.
      Returns:
      A CompositePrivateKey created from all components in the sequence.
      Throws:
      IOException
    • generatePublic

      public PublicKey generatePublic(SubjectPublicKeyInfo keyInfo) throws IOException
      Creates a CompositePublicKey from its SubjectPublicKeyInfo encoded form. It is compliant with https://www.ietf.org/archive/id/draft-ounsworth-pq-composite-sigs-13.html where CompositeSignaturePublicKey is a sequence of two BIT STRINGs which contain the encoded component public keys. In BC implementation - CompositePublicKey is encoded into a BIT STRING in the form of SubjectPublicKeyInfo.
      Parameters:
      keyInfo - SubjectPublicKeyInfo containing a sequence of BIT STRINGs corresponding to each component.
      Returns:
      Throws:
      IOException