public class AndroidKeyStoreKeyFactorySpi extends KeyFactorySpi
KeyFactorySpi
backed by Android KeyStore.Constructor and Description |
---|
AndroidKeyStoreKeyFactorySpi() |
Modifier and Type | Method and Description |
---|---|
protected PrivateKey |
engineGeneratePrivate(KeySpec spec)
Generates a private key object from the provided key
specification (key material).
|
protected PublicKey |
engineGeneratePublic(KeySpec spec)
Generates a public key object from the provided key
specification (key material).
|
protected <T extends KeySpec> |
engineGetKeySpec(Key key,
Class<T> keySpecClass)
Returns a specification (key material) of the given key
object.
|
protected Key |
engineTranslateKey(Key key)
Translates a key object, whose provider may be unknown or
potentially untrusted, into a corresponding key object of this key
factory.
|
protected <T extends KeySpec> T engineGetKeySpec(Key key, Class<T> keySpecClass) throws InvalidKeySpecException
KeyFactorySpi
keySpec
identifies the specification class in which
the key material should be returned. It could, for example, be
DSAPublicKeySpec.class
, to indicate that the
key material should be returned in an instance of the
DSAPublicKeySpec
class.engineGetKeySpec
in class KeyFactorySpi
key
- the key.keySpecClass
- the specification class in which
the key material should be returned.InvalidKeySpecException
- if the requested key specification is
inappropriate for the given key, or the given key cannot be dealt with
(e.g., the given key has an unrecognized format).protected PrivateKey engineGeneratePrivate(KeySpec spec) throws InvalidKeySpecException
KeyFactorySpi
engineGeneratePrivate
in class KeyFactorySpi
spec
- the specification (key material) of the private key.InvalidKeySpecException
- if the given key specification
is inappropriate for this key factory to produce a private key.protected PublicKey engineGeneratePublic(KeySpec spec) throws InvalidKeySpecException
KeyFactorySpi
engineGeneratePublic
in class KeyFactorySpi
spec
- the specification (key material) of the public key.InvalidKeySpecException
- if the given key specification
is inappropriate for this key factory to produce a public key.protected Key engineTranslateKey(Key key) throws InvalidKeyException
KeyFactorySpi
engineTranslateKey
in class KeyFactorySpi
key
- the key whose provider is unknown or untrusted.InvalidKeyException
- if the given key cannot be processed
by this key factory.