Class McElieceCCA2KeyFactorySpi
java.lang.Object
java.security.KeyFactorySpi
org.bouncycastle.pqc.jcajce.provider.mceliece.McElieceCCA2KeyFactorySpi
- All Implemented Interfaces:
AsymmetricKeyInfoConverter
This class is used to translate between McEliece CCA2 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 aBCMcElieceCCA2PrivateKey.protected PublicKeyengineGeneratePublic(KeySpec keySpec) Converts, if possible, a key specification into aBCMcElieceCCA2PublicKey.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
-
McElieceCCA2KeyFactorySpi
public McElieceCCA2KeyFactorySpi()
-
-
Method Details
-
engineGeneratePublic
Converts, if possible, a key specification into aBCMcElieceCCA2PublicKey. Currently, the following key specifications are supported:X509EncodedKeySpec.- Specified by:
engineGeneratePublicin classKeyFactorySpi- Parameters:
keySpec- the key specification- Returns:
- the McEliece CCA2 public key
- Throws:
InvalidKeySpecException- if the key specification is not supported.
-
engineGeneratePrivate
Converts, if possible, a key specification into aBCMcElieceCCA2PrivateKey. Currently, the following key specifications are supported:PKCS8EncodedKeySpec.- Specified by:
engineGeneratePrivatein classKeyFactorySpi- Parameters:
keySpec- the key specification- Returns:
- the McEliece CCA2 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 CCA2 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:BCMcElieceCCA2PrivateKey,BCMcElieceCCA2PublicKey.- 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
-