Class BaseSecretKeyFactory
- java.lang.Object
-
- javax.crypto.SecretKeyFactorySpi
-
- org.bouncycastle.jcajce.provider.symmetric.util.BaseSecretKeyFactory
-
- All Implemented Interfaces:
PBE
- Direct Known Subclasses:
DES.DESPBEKeyFactory,DES.KeyFactory,DESede.KeyFactory,PBESecretKeyFactory,SHA1.BasePBKDF2WithHmacSHA1
public class BaseSecretKeyFactory extends SecretKeyFactorySpi implements PBE
-
-
Field Summary
Fields Modifier and Type Field Description protected StringalgNameprotected ASN1ObjectIdentifieralgOid-
Fields inherited from interface org.bouncycastle.jcajce.provider.symmetric.util.PBE
MD5, OPENSSL, PKCS12, PKCS5S1, PKCS5S1_UTF8, PKCS5S2, PKCS5S2_UTF8, SHA1, SHA256
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseSecretKeyFactory(String algName, ASN1ObjectIdentifier algOid)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SecretKeyengineGenerateSecret(KeySpec keySpec)Generate a secret key from the specified key specification.protected KeySpecengineGetKeySpec(SecretKey key, Class keySpec)Returns the key specification of the specified secret key.protected SecretKeyengineTranslateKey(SecretKey key)Translates the specified secret key into an instance of the corresponding key from the provider of this key factory.
-
-
-
Field Detail
-
algName
protected String algName
-
algOid
protected ASN1ObjectIdentifier algOid
-
-
Constructor Detail
-
BaseSecretKeyFactory
protected BaseSecretKeyFactory(String algName, ASN1ObjectIdentifier algOid)
-
-
Method Detail
-
engineGenerateSecret
protected SecretKey engineGenerateSecret(KeySpec keySpec) throws InvalidKeySpecException
Description copied from class:SecretKeyFactorySpiGenerate a secret key from the specified key specification.- Specified by:
engineGenerateSecretin classSecretKeyFactorySpi- Parameters:
keySpec- the key specification.- Returns:
- a secret key.
- Throws:
InvalidKeySpecException- if the specified key specification cannot be used to generate a secret key.
-
engineGetKeySpec
protected KeySpec engineGetKeySpec(SecretKey key, Class keySpec) throws InvalidKeySpecException
Description copied from class:SecretKeyFactorySpiReturns the key specification of the specified secret key.- Specified by:
engineGetKeySpecin classSecretKeyFactorySpi- Parameters:
key- the secret key to get the specification from.keySpec- the target key specification class.- Returns:
- an instance of the specified key specification class.
- Throws:
InvalidKeySpecException- if the specified secret key cannot be transformed into the requested key specification.
-
engineTranslateKey
protected SecretKey engineTranslateKey(SecretKey key) throws InvalidKeyException
Description copied from class:SecretKeyFactorySpiTranslates the specified secret key into an instance of the corresponding key from the provider of this key factory.- Specified by:
engineTranslateKeyin classSecretKeyFactorySpi- Parameters:
key- the secret key to translate.- Returns:
- the corresponding translated key.
- Throws:
InvalidKeyException- if the specified key cannot be translated using this key factory.
-
-