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.PrivateKeyengineGeneratePrivate(java.security.spec.KeySpec keySpec)We don't support RSAPrivateKeySpec because it doesn't have enough information.protected java.security.PublicKeyengineGeneratePublic(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.KeyengineTranslateKey(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:
engineGeneratePublicin classjava.security.KeyFactorySpi- Throws:
java.security.spec.InvalidKeySpecException
-
engineGeneratePrivate
protected java.security.PrivateKey engineGeneratePrivate(java.security.spec.KeySpec keySpec) throws java.security.spec.InvalidKeySpecExceptionWe don't support RSAPrivateKeySpec because it doesn't have enough information. You need to provide an RSAPrivateCrtKeySpec.- Specified by:
engineGeneratePrivatein 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:
engineGetKeySpecin classjava.security.KeyFactorySpi- Throws:
java.security.spec.InvalidKeySpecException
-
engineTranslateKey
protected java.security.Key engineTranslateKey(java.security.Key key) throws java.security.InvalidKeyExceptionTranslates 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 classjava.security.KeyFactorySpi- Throws:
java.security.InvalidKeyException
-
-