Class KeyFactorySpi1_2
- java.lang.Object
-
- java.security.KeyFactorySpi
-
- org.mozilla.jss.provider.java.security.KeyFactorySpi1_2
-
public class KeyFactorySpi1_2 extends java.security.KeyFactorySpi
-
-
Constructor Summary
Constructors Constructor Description KeyFactorySpi1_2()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.security.PrivateKey
engineGeneratePrivate(java.security.spec.KeySpec keySpec)
We don't support RSAPrivateKeySpec because it doesn't have enough information.protected java.security.PublicKey
engineGeneratePublic(java.security.spec.KeySpec keySpec)
protected <T extends java.security.spec.KeySpec>
TengineGetKeySpec(java.security.Key key, java.lang.Class<T> keySpec)
protected java.security.Key
engineTranslateKey(java.security.Key key)
Translates key by calling getEncoded() to get its encoded form, then importing the key from its encoding.
-
-
-
Method Detail
-
engineGeneratePublic
protected java.security.PublicKey engineGeneratePublic(java.security.spec.KeySpec keySpec) throws java.security.spec.InvalidKeySpecException
- Specified by:
engineGeneratePublic
in classjava.security.KeyFactorySpi
- Throws:
java.security.spec.InvalidKeySpecException
-
engineGeneratePrivate
protected java.security.PrivateKey engineGeneratePrivate(java.security.spec.KeySpec keySpec) throws java.security.spec.InvalidKeySpecException
We don't support RSAPrivateKeySpec because it doesn't have enough information. You need to provide an RSAPrivateCrtKeySpec.- Specified by:
engineGeneratePrivate
in classjava.security.KeyFactorySpi
- Throws:
java.security.spec.InvalidKeySpecException
-
engineGetKeySpec
protected <T extends java.security.spec.KeySpec> T engineGetKeySpec(java.security.Key key, java.lang.Class<T> keySpec) throws java.security.spec.InvalidKeySpecException
- Specified by:
engineGetKeySpec
in classjava.security.KeyFactorySpi
- Throws:
java.security.spec.InvalidKeySpecException
-
engineTranslateKey
protected java.security.Key engineTranslateKey(java.security.Key key) throws java.security.InvalidKeyException
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 classjava.security.KeyFactorySpi
- Throws:
java.security.InvalidKeyException
-
-