Package org.cryptacular.pbe
Class PBES2EncryptionScheme
java.lang.Object
org.cryptacular.pbe.AbstractEncryptionScheme
org.cryptacular.pbe.PBES2EncryptionScheme
- All Implemented Interfaces:
EncryptionScheme
Implements the PBES2 encryption scheme defined in PKCS#5v2.
- Version:
- $Revision: 2744 $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Map<org.bouncycastle.asn1.ASN1ObjectIdentifier, DigestSpec> Map of HMAC algorithm identifiers to digest specifications.private intSize of derived key in bits. -
Constructor Summary
ConstructorsConstructorDescriptionPBES2EncryptionScheme(org.bouncycastle.asn1.pkcs.PBES2Parameters params, char[] password) Creates a new instance with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidinitCipher(org.bouncycastle.crypto.generators.PKCS5S2ParametersGenerator generator, org.bouncycastle.asn1.pkcs.EncryptionScheme scheme) Initializes the block cipher and sets up its initialization parameters.Methods inherited from class org.cryptacular.pbe.AbstractEncryptionScheme
decrypt, decrypt, encrypt, encrypt, setCipher, setCipherParameters, wrap
-
Field Details
-
HMAC_ID_TO_DIGEST_SPEC_MAP
private static final Map<org.bouncycastle.asn1.ASN1ObjectIdentifier,DigestSpec> HMAC_ID_TO_DIGEST_SPEC_MAPMap of HMAC algorithm identifiers to digest specifications. -
keyLength
private int keyLengthSize of derived key in bits.
-
-
Constructor Details
-
PBES2EncryptionScheme
public PBES2EncryptionScheme(org.bouncycastle.asn1.pkcs.PBES2Parameters params, char[] password) Creates a new instance with the given parameters.- Parameters:
params- PBES2 parameters describing the key derivation function and encryption scheme.password- Password used to derive key.
-
-
Method Details
-
initCipher
private void initCipher(org.bouncycastle.crypto.generators.PKCS5S2ParametersGenerator generator, org.bouncycastle.asn1.pkcs.EncryptionScheme scheme) Initializes the block cipher and sets up its initialization parameters.- Parameters:
generator- Derived key generator.scheme- PKCS#5 encryption scheme.
-