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
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description protected StringalgNameprotected ASN1ObjectIdentifieralgOidFields 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
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 Details
-
algName
-
algOid
-
-
Constructor Details
-
BaseSecretKeyFactory
-
-
Method Details
-
engineGenerateSecret
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
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
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.
-