Top Inners Fields Constructors Methods
org.bouncycastle.jcajce.provider

pack-priv Class BaseSecretKeyFactory

extends SecretKeyFactorySpi
Class Inheritance
Known Direct Subclasses
org.bouncycastle.jcajce.provider.ProvDES.KeyFactory, org.bouncycastle.jcajce.provider.ProvDESede.KeyFactory
Imports
java.lang.reflect.Constructor, java.security.InvalidKeyException, java.security.spec.InvalidKeySpecException, .KeySpec, javax.crypto.SecretKey, .SecretKeyFactorySpi, javax.crypto.spec.PBEKeySpec, .SecretKeySpec, org.bouncycastle.crypto.Algorithm, .PasswordConverter, org.bouncycastle.crypto.fips.FipsSHS, org.bouncycastle.crypto.internal.ValidatedSymmetricKey

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static interface

Field Summary

Modifier and TypeField and Description
protected final Algorithm
protected final String
protected final BaseSecretKeyFactory.Validator

Constructor Summary

AccessConstructor and Description
pack-priv

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
secretKey
)

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.
protected KeySpec

Field Detail

algorithmback to summary
protected final Algorithm algorithm
algorithmNameback to summary
protected final String algorithmName
validatorback to summary
protected final BaseSecretKeyFactory.Validator validator

Constructor Detail

BaseSecretKeyFactoryback to summary
pack-priv BaseSecretKeyFactory(String algorithmName, Algorithm algorithm, BaseSecretKeyFactory.Validator validator)

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

Annotations
@Override
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 secretKey) 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
secretKey:SecretKey

the key whose provider is unknown or untrusted

Returns:SecretKey

the translated key

Annotations
@Override
Exceptions
InvalidKeyException:
if the given key cannot be processed by this secret-key factory.
genericGetKeySpecback to summary
protected KeySpec genericGetKeySpec(SecretKey key, Class<T> keySpec) throws InvalidKeySpecException
org.bouncycastle.jcajce.provider back to summary

pack-priv Interface BaseSecretKeyFactory.Validator


Method Summary

Modifier and TypeMethod and Description
public byte[]
validated(byte[] keyBytes)

Method Detail

validatedback to summary
public byte[] validated(byte[] keyBytes) throws InvalidKeySpecException