Class McElieceKeyFactorySpi
java.lang.Object
java.security.KeyFactorySpi
org.bouncycastle.pqc.jcajce.provider.mceliece.McElieceKeyFactorySpi
- All Implemented Interfaces:
AsymmetricKeyInfoConverter
This class is used to translate between McEliece keys and key specifications.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PrivateKeyengineGeneratePrivate(KeySpec keySpec) Converts, if possible, a key specification into aBCMcEliecePrivateKey.protected PublicKeyengineGeneratePublic(KeySpec keySpec) Converts, if possible, a key specification into aBCMcEliecePublicKey.protected KeySpecengineGetKeySpec(Key key, Class tClass) protected KeyengineTranslateKey(Key key) getKeySpec(Key key, Class keySpec) Converts, if possible, a given key into a key specification.translateKey(Key key) Translates a key into a form known by the FlexiProvider.
-
Field Details
-
OID
The OID of the algorithm.- See Also:
-
-
Constructor Details
-
McElieceKeyFactorySpi
public McElieceKeyFactorySpi()
-
-
Method Details
-
engineGeneratePublic
Converts, if possible, a key specification into aBCMcEliecePublicKey.X509EncodedKeySpec.- Specified by:
engineGeneratePublicin classKeyFactorySpi- Parameters:
keySpec- the key specification- Returns:
- the McEliece public key
- Throws:
InvalidKeySpecException- if the key specification is not supported.
-
engineGeneratePrivate
Converts, if possible, a key specification into aBCMcEliecePrivateKey.- Specified by:
engineGeneratePrivatein classKeyFactorySpi- Parameters:
keySpec- the key specification- Returns:
- the McEliece private key
- Throws:
InvalidKeySpecException- if the KeySpec is not supported.
-
getKeySpec
Converts, if possible, a given key into a key specification. Currently, the following key specifications are supported:- Parameters:
key- the keykeySpec- the key specification- Returns:
- the specification of the McEliece key
- Throws:
InvalidKeySpecException- if the key type or the key specification is not supported.- See Also:
-
translateKey
Translates a key into a form known by the FlexiProvider. Currently, only the following "source" keys are supported:BCMcEliecePrivateKey,BCMcEliecePublicKey.- Parameters:
key- the key- Returns:
- a key of a known key type
- Throws:
InvalidKeyException- if the key type is not supported.
-
generatePublic
- Specified by:
generatePublicin interfaceAsymmetricKeyInfoConverter- Throws:
IOException
-
generatePrivate
- Specified by:
generatePrivatein interfaceAsymmetricKeyInfoConverter- Throws:
IOException
-
engineGetKeySpec
- Specified by:
engineGetKeySpecin classKeyFactorySpi- Throws:
InvalidKeySpecException
-
engineTranslateKey
- Specified by:
engineTranslateKeyin classKeyFactorySpi- Throws:
InvalidKeyException
-