Class KeyFactorySpi1_2
java.lang.Object
java.security.KeyFactorySpi
org.mozilla.jss.provider.java.security.KeyFactorySpi1_2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate byte[]convertIntToBigEndian(BigInteger elem, int size) protected PrivateKeyengineGeneratePrivate(KeySpec keySpec) We don't support RSAPrivateKeySpec because it doesn't have enough information.protected PublicKeyengineGeneratePublic(KeySpec keySpec) protected <T extends KeySpec>
TengineGetKeySpec(Key key, Class<T> keySpec) protected KeyengineTranslateKey(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:
engineGeneratePublicin classKeyFactorySpi- Throws:
InvalidKeySpecException
-
engineGeneratePrivate
We don't support RSAPrivateKeySpec because it doesn't have enough information. You need to provide an RSAPrivateCrtKeySpec.- Specified by:
engineGeneratePrivatein classKeyFactorySpi- Throws:
InvalidKeySpecException
-
engineGetKeySpec
protected <T extends KeySpec> T engineGetKeySpec(Key key, Class<T> keySpec) throws InvalidKeySpecException - Specified by:
engineGetKeySpecin 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:
engineTranslateKeyin classKeyFactorySpi- Throws:
InvalidKeyException
-
convertIntToBigEndian
-