Class KeyFactorySpi
- 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 implements AsymmetricKeyInfoConverter
KeyFactory for composite signatures. The supported combinations are listed inCompositeIndex.
-
-
Constructor Summary
Constructors Constructor Description KeyFactorySpi()KeyFactorySpi(JcaJceHelper helper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.security.KeyengineTranslateKey(java.security.Key key)java.security.PrivateKeygeneratePrivate(PrivateKeyInfo keyInfo)Creates a CompositePrivateKey from its PrivateKeyInfo encoded form.java.security.PublicKeygeneratePublic(SubjectPublicKeyInfo keyInfo)Creates a CompositePublicKey from its SubjectPublicKeyInfo encoded form.-
Methods inherited from class org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi
engineGeneratePrivate, engineGeneratePublic, engineGetKeySpec
-
-
-
-
Constructor Detail
-
KeyFactorySpi
public KeyFactorySpi()
-
KeyFactorySpi
public KeyFactorySpi(JcaJceHelper helper)
-
-
Method Detail
-
engineTranslateKey
protected java.security.Key engineTranslateKey(java.security.Key key) throws java.security.InvalidKeyException- Specified by:
engineTranslateKeyin classjava.security.KeyFactorySpi- Throws:
java.security.InvalidKeyException
-
generatePrivate
public java.security.PrivateKey generatePrivate(PrivateKeyInfo keyInfo) throws java.io.IOException
Creates a CompositePrivateKey from its PrivateKeyInfo encoded form.For the current OIDs (draft-ietf-lamps-pq-composite-sigs, IANA arc 1.3.6.1.5.5.7.6.37-54) the privateKey body is the bare concatenation mldsaSeed || tradSK, with no inner ASN.1 structure. The superseded Entrust/OpenCA OIDs, whose body is a SEQUENCE of OneAsymmetricKey (the newer name for PrivateKeyInfo), are still decoded for compatibility.
- Specified by:
generatePrivatein interfaceAsymmetricKeyInfoConverter- Parameters:
keyInfo- PrivateKeyInfo carrying the composite private key body.- Returns:
- A CompositePrivateKey created from all components in the body.
- Throws:
java.io.IOException
-
generatePublic
public java.security.PublicKey generatePublic(SubjectPublicKeyInfo keyInfo) throws java.io.IOException
Creates a CompositePublicKey from its SubjectPublicKeyInfo encoded form.For the current OIDs (draft-ietf-lamps-pq-composite-sigs, IANA arc 1.3.6.1.5.5.7.6.37-54) the subjectPublicKey BIT STRING holds the bare concatenation mldsaPK || tradPK, split at the fixed ML-DSA public key length. The superseded encodings - a SEQUENCE of SubjectPublicKeyInfo, or of BIT STRINGs - are still decoded for compatibility, which is why the sequence parse is attempted first and the fixed-length split is reached from its catch branch.
- Specified by:
generatePublicin interfaceAsymmetricKeyInfoConverter- Parameters:
keyInfo- SubjectPublicKeyInfo carrying the composite public key body.- Returns:
- A CompositePublicKey created from all components in the body.
- Throws:
java.io.IOException
-
-