Top Fields Constructors Methods
org.bouncycastle.jcajce.provider.symmetric.util

public Class BaseSecretKeyFactory

extends SecretKeyFactorySpi
implements PBE
Class Inheritance
All Implemented Interfaces
org.bouncycastle.jcajce.provider.symmetric.util.PBE
Known Direct Subclasses
org.bouncycastle.jcajce.provider.symmetric.util.PBESecretKeyFactory, org.bouncycastle.jcajce.provider.symmetric.AES.KeyFactory, org.bouncycastle.jcajce.provider.symmetric.ARIA.KeyFactory, org.bouncycastle.jcajce.provider.symmetric.Camellia.KeyFactory, org.bouncycastle.jcajce.provider.symmetric.DES.KeyFactory, org.bouncycastle.jcajce.provider.symmetric.DES.DESPBEKeyFactory, org.bouncycastle.jcajce.provider.symmetric.DESede.KeyFactory, org.bouncycastle.jcajce.provider.symmetric.OpenSSLPBKDF.PBKDF, org.bouncycastle.jcajce.provider.symmetric.PBEPBKDF2.BasePBKDF2, org.bouncycastle.jcajce.provider.symmetric.SCRYPT.BasePBKDF2, org.bouncycastle.jcajce.provider.symmetric.SEED.KeyFactory, org.bouncycastle.jcajce.provider.symmetric.TLSKDF.TLSKeyMaterialFactory
Imports
java.lang.reflect.Constructor, java.security.InvalidKeyException, java.security.spec.InvalidKeySpecException, .KeySpec, javax.crypto.SecretKey, .SecretKeyFactorySpi, javax.crypto.spec.SecretKeySpec, org.bouncycastle.asn1.ASN1ObjectIdentifier

Field Summary

Modifier and TypeField and Description
protected String
protected ASN1ObjectIdentifier

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected SecretKey
engineGenerateSecret(KeySpec
the specification (key material) of the secret key
keySpec
)

Implements abstract javax.crypto.SecretKeyFactorySpi.engineGenerateSecret.

Generates a SecretKey object from the provided key specification (key material).
protected KeySpec
engineGetKeySpec(SecretKey
the key
key
,
Class<T>
the requested format in which the key material shall be returned
keySpec
)

Implements abstract javax.crypto.SecretKeyFactorySpi.engineGetKeySpec.

Returns a specification (key material) of the given key object in the requested format.
protected SecretKey
engineTranslateKey(SecretKey
the key whose provider is unknown or untrusted
key
)

Implements abstract javax.crypto.SecretKeyFactorySpi.engineTranslateKey.

Translates a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this secret-key factory.

Field Detail

algNameback to summary
protected String algName
algOidback to summary
protected ASN1ObjectIdentifier algOid

Constructor Detail

BaseSecretKeyFactoryback to summary
protected BaseSecretKeyFactory(String algName, ASN1ObjectIdentifier algOid)

Method Detail

engineGenerateSecretback to summary
protected SecretKey engineGenerateSecret(KeySpec keySpec) throws InvalidKeySpecException

Implements abstract javax.crypto.SecretKeyFactorySpi.engineGenerateSecret.

Doc from javax.crypto.SecretKeyFactorySpi.engineGenerateSecret.

Generates a SecretKey object from the provided key specification (key material).

Parameters
keySpec:KeySpec

the specification (key material) of the secret key

Returns:SecretKey

the secret key

Exceptions
InvalidKeySpecException:
if the given key specification is inappropriate for this secret-key factory to produce a secret key.
engineGetKeySpecback to summary
protected KeySpec engineGetKeySpec(SecretKey key, Class<T> keySpec) throws InvalidKeySpecException

Implements abstract javax.crypto.SecretKeyFactorySpi.engineGetKeySpec.

Doc from javax.crypto.SecretKeyFactorySpi.engineGetKeySpec.

Returns a specification (key material) of the given key object in the requested format.

Parameters
key:SecretKey

the key

keySpec:Class<T>

the requested format in which the key material shall be returned

Returns:KeySpec

the underlying key specification (key material) in the requested format

Exceptions
InvalidKeySpecException:
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).
engineTranslateKeyback to summary
protected SecretKey engineTranslateKey(SecretKey key) throws InvalidKeyException

Implements abstract javax.crypto.SecretKeyFactorySpi.engineTranslateKey.

Doc from javax.crypto.SecretKeyFactorySpi.engineTranslateKey.

Translates a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this secret-key factory.

Parameters
key:SecretKey

the key whose provider is unknown or untrusted

Returns:SecretKey

the translated key

Exceptions
InvalidKeyException:
if the given key cannot be processed by this secret-key factory.