Class KeyFactorySpi1_2
java.lang.Object
java.security.KeyFactorySpi
org.mozilla.jss.provider.java.security.KeyFactorySpi1_2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PrivateKey
engineGeneratePrivate
(KeySpec keySpec) We don't support RSAPrivateKeySpec because it doesn't have enough information.protected PublicKey
engineGeneratePublic
(KeySpec keySpec) protected <T extends KeySpec>
TengineGetKeySpec
(Key key, Class<T> keySpec) protected Key
engineTranslateKey
(Key key) Translates key by calling getEncoded() to get its encoded form, then importing the key from its encoding.
-
Constructor Details
-
KeyFactorySpi1_2
public KeyFactorySpi1_2()
-
-
Method Details
-
engineGeneratePublic
- Specified by:
engineGeneratePublic
in classKeyFactorySpi
- Throws:
InvalidKeySpecException
-
engineGeneratePrivate
We don't support RSAPrivateKeySpec because it doesn't have enough information. You need to provide an RSAPrivateCrtKeySpec.- Specified by:
engineGeneratePrivate
in classKeyFactorySpi
- Throws:
InvalidKeySpecException
-
engineGetKeySpec
protected <T extends KeySpec> T engineGetKeySpec(Key key, Class<T> keySpec) throws InvalidKeySpecException - Specified by:
engineGetKeySpec
in classKeyFactorySpi
- Throws:
InvalidKeySpecException
-
engineTranslateKey
Translates key by calling getEncoded() to get its encoded form, then importing the key from its encoding. Two formats are supported: "X.509", which is decoded with an X509EncodedKeySpec; and "PKCS#8", which is decoded with a PKCS8EncodedKeySpec.This method is not well standardized: the documentation is very vague about how the key is supposed to be translated. It is better to move keys around by wrapping and unwrapping them; or by manually translating to a KeySpec, then manually translating back to a Key.
- Specified by:
engineTranslateKey
in classKeyFactorySpi
- Throws:
InvalidKeyException
-