Class KeyFactorySpi
- All Implemented Interfaces:
AsymmetricKeyInfoConverter
CompositeIndex.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected KeyengineTranslateKey(Key key) generatePrivate(PrivateKeyInfo keyInfo) Creates a CompositePrivateKey from its PrivateKeyInfo encoded form.generatePublic(SubjectPublicKeyInfo keyInfo) Creates a CompositePublicKey from its SubjectPublicKeyInfo encoded form.Methods inherited from class BaseKeyFactorySpi
engineGeneratePrivate, engineGeneratePublic, engineGetKeySpec
-
Constructor Details
-
KeyFactorySpi
public KeyFactorySpi() -
KeyFactorySpi
-
-
Method Details
-
engineTranslateKey
- Specified by:
engineTranslateKeyin classKeyFactorySpi- Throws:
InvalidKeyException
-
generatePrivate
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:
IOException
-
generatePublic
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:
IOException
-