Class KeyFactorySpi
java.lang.Object
java.security.KeyFactorySpi
org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi
org.bouncycastle.jcajce.provider.asymmetric.compositekem.KeyFactorySpi
- All Implemented Interfaces:
AsymmetricKeyInfoConverter
KeyFactory for Composite ML-KEM keys as defined in
Composite ML-KEM for use in X.509 Public Key Infrastructure.
The supported parameter sets are registered in
CompositeIndex.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected KeyengineTranslateKey(Key key) generatePrivate(PrivateKeyInfo keyInfo) Creates aCompositePrivateKeyfrom its PrivateKeyInfo encoded form.generatePublic(SubjectPublicKeyInfo keyInfo) Creates aCompositePublicKeyfrom 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 aCompositePrivateKeyfrom its PrivateKeyInfo encoded form. Per draft-ietf-lamps-pq-composite-kem the private key body is the 64-byte ML-KEM seed concatenated with the traditional private key encoding; the two components are split and decoded with their respective component key factories.- Specified by:
generatePrivatein interfaceAsymmetricKeyInfoConverter- Parameters:
keyInfo- PrivateKeyInfo whose key body is the concatenation of the two component keys.- Returns:
- A CompositePrivateKey holding both component private keys.
- Throws:
IOException- on a malformed encoding.
-
generatePublic
Creates aCompositePublicKeyfrom its SubjectPublicKeyInfo encoded form. Per draft-ietf-lamps-pq-composite-kem the public key is the concatenation of the two raw component public keys; it is split at the fixed ML-KEM public key size and each component is decoded with its key factory.- Specified by:
generatePublicin interfaceAsymmetricKeyInfoConverter- Parameters:
keyInfo- SubjectPublicKeyInfo whose key body is the concatenation of the two component public keys.- Returns:
- A CompositePublicKey holding both component public keys.
- Throws:
IOException- on a malformed encoding.
-