public class AndroidKeyStoreSecretKeyFactorySpi extends SecretKeyFactorySpi
SecretKeyFactorySpi
backed by Android Keystore.Constructor and Description |
---|
AndroidKeyStoreSecretKeyFactorySpi() |
Modifier and Type | Method and Description |
---|---|
protected SecretKey |
engineGenerateSecret(KeySpec keySpec)
Generates a
SecretKey object from the
provided key specification (key material). |
protected KeySpec |
engineGetKeySpec(SecretKey key,
Class keySpecClass)
Returns a specification (key material) of the given key
object in the requested format.
|
protected SecretKey |
engineTranslateKey(SecretKey key)
Translates a key object, whose provider may be unknown or
potentially untrusted, into a corresponding key object of this
secret-key factory.
|
protected KeySpec engineGetKeySpec(SecretKey key, Class keySpecClass) throws InvalidKeySpecException
SecretKeyFactorySpi
engineGetKeySpec
in class SecretKeyFactorySpi
key
- the keykeySpecClass
- the requested format in which the key material shall be
returnedInvalidKeySpecException
- if the requested key specification is
inappropriate for the given key (e.g., the algorithms associated with
key
and keySpec
do not match, or
key
references a key on a cryptographic hardware device
whereas keySpec
is the specification of a software-based
key), or the given key cannot be dealt with
(e.g., the given key has an algorithm or format not supported by this
secret-key factory).protected SecretKey engineGenerateSecret(KeySpec keySpec) throws InvalidKeySpecException
SecretKeyFactorySpi
SecretKey
object from the
provided key specification (key material).engineGenerateSecret
in class SecretKeyFactorySpi
keySpec
- the specification (key material) of the secret keyInvalidKeySpecException
- if the given key specification
is inappropriate for this secret-key factory to produce a secret key.protected SecretKey engineTranslateKey(SecretKey key) throws InvalidKeyException
SecretKeyFactorySpi
engineTranslateKey
in class SecretKeyFactorySpi
key
- the key whose provider is unknown or untrustedInvalidKeyException
- if the given key cannot be processed
by this secret-key factory.