public class GeneralKeyFactory
extends javax.crypto.SecretKeyFactorySpi
Constructor and Description |
---|
GeneralKeyFactory()
Constructor used by getInstance().
|
Modifier and Type | Method and Description |
---|---|
protected javax.crypto.SecretKey |
engineGenerateSecret(java.security.spec.KeySpec keySpec)
Converts the given key specification (key material) into a SecretKey
object.
|
protected java.security.spec.KeySpec |
engineGetKeySpec(javax.crypto.SecretKey secretKey,
java.lang.Class classSpec)
Converts the given secret key into the requested key specification (key
material).
|
protected javax.crypto.SecretKey |
engineTranslateKey(javax.crypto.SecretKey secretKey)
Translates a key object of some unknown or untrusted provider into a secret
key object of this key factory.
|
protected javax.crypto.SecretKey engineGenerateSecret(java.security.spec.KeySpec keySpec) throws java.security.spec.InvalidKeySpecException
The supplied keySpec may be an instance of
javax.crypto.spec.SecretKeySpec
,
javax.crypto.spec.DESKeySpec
or
javax.crypto.spec.DESedeKeySpec
.
engineGenerateSecret
in class javax.crypto.SecretKeyFactorySpi
keySpec
- the specification (key material) to be converted into SecretKey
representation.java.security.spec.InvalidKeySpecException
- if the given key material cannot be converted into a SecretKey
object by this key factoryprotected java.security.spec.KeySpec engineGetKeySpec(javax.crypto.SecretKey secretKey, java.lang.Class classSpec) throws java.security.spec.InvalidKeySpecException
This method may be used for getting a
javax.crypto.spec.SecretKeySpec
,
javax.crypto.spec.DESKeySpec
, or
javax.crypto.spec.DESedeKeySpec
from the given secret key.
engineGetKeySpec
in class javax.crypto.SecretKeyFactorySpi
secretKey
- the secret key to be convertedclassSpec
- the class implementing the requested secret key specjava.security.spec.InvalidKeySpecException
- if the given secret key cannot be converted into the requested
key specification object by this key factoryprotected javax.crypto.SecretKey engineTranslateKey(javax.crypto.SecretKey secretKey) throws java.security.InvalidKeyException
engineTranslateKey
in class javax.crypto.SecretKeyFactorySpi
secretKey
- the key of some unknown or untrusted providerjava.security.InvalidKeyException
- if the given key cannot be translated by this key factory