Package org.bouncycastle.pkcs.jcajce
Class JcePBMac1CalculatorBuilder
java.lang.Object
org.bouncycastle.pkcs.jcajce.JcePBMac1CalculatorBuilder
A builder for RFC 8018 PBE based MAC calculators.
By default the class uses HMAC-SHA256 as the PRF, with an iteration count of 8192. The default salt length is the output size of the MAC being used.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.bouncycastle.asn1.x509.AlgorithmIdentifier
static final org.bouncycastle.asn1.x509.AlgorithmIdentifier
static final org.bouncycastle.asn1.x509.AlgorithmIdentifier
static final org.bouncycastle.asn1.x509.AlgorithmIdentifier
static final org.bouncycastle.asn1.x509.AlgorithmIdentifier
static final org.bouncycastle.asn1.x509.AlgorithmIdentifier
static final org.bouncycastle.asn1.x509.AlgorithmIdentifier
static final org.bouncycastle.asn1.x509.AlgorithmIdentifier
-
Constructor Summary
ConstructorDescriptionJcePBMac1CalculatorBuilder
(String macAlgorithm, int keySize) Base constructor - MAC name and key size.JcePBMac1CalculatorBuilder
(String macAlgorithm, int keySize, MacAlgorithmIdentifierFinder algIdFinder) Base constructor - MAC name and key size with a custom AlgorithmIdentifier finder for the MAC algorithm.JcePBMac1CalculatorBuilder
(org.bouncycastle.asn1.pkcs.PBMAC1Params pbeMacParams) Base constructor from an ASN.1 parameter set. -
Method Summary
Modifier and TypeMethodDescriptionbuild
(char[] password) setIterationCount
(int iterationCount) setPrf
(org.bouncycastle.asn1.x509.AlgorithmIdentifier prf) setProvider
(String providerName) setProvider
(Provider provider) setRandom
(SecureRandom random) setSalt
(byte[] salt) setSaltLength
(int saltLength) Set the length of the salt in bytes.
-
Field Details
-
PRF_SHA224
public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier PRF_SHA224 -
PRF_SHA256
public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier PRF_SHA256 -
PRF_SHA384
public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier PRF_SHA384 -
PRF_SHA512
public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier PRF_SHA512 -
PRF_SHA3_224
public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier PRF_SHA3_224 -
PRF_SHA3_256
public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier PRF_SHA3_256 -
PRF_SHA3_384
public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier PRF_SHA3_384 -
PRF_SHA3_512
public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier PRF_SHA3_512
-
-
Constructor Details
-
JcePBMac1CalculatorBuilder
Base constructor - MAC name and key size.- Parameters:
macAlgorithm
- name of the MAC algorithm.keySize
- the key size in bits.
-
JcePBMac1CalculatorBuilder
public JcePBMac1CalculatorBuilder(String macAlgorithm, int keySize, MacAlgorithmIdentifierFinder algIdFinder) Base constructor - MAC name and key size with a custom AlgorithmIdentifier finder for the MAC algorithm.- Parameters:
macAlgorithm
- name of the MAC algorithm.keySize
- the key size in bits.algIdFinder
- an AlgorithmIdentifier finder containing the specified MAC name.
-
JcePBMac1CalculatorBuilder
public JcePBMac1CalculatorBuilder(org.bouncycastle.asn1.pkcs.PBMAC1Params pbeMacParams) Base constructor from an ASN.1 parameter set. See RFC 8108 for details.- Parameters:
pbeMacParams
- the ASN.1 parameters for the MAC calculator we want to create.
-
-
Method Details
-
setProvider
-
setProvider
-
setIterationCount
-
setSaltLength
Set the length of the salt in bytes.- Parameters:
saltLength
-- Returns:
-
setSalt
-
setRandom
-
setPrf
-
build
- Throws:
OperatorCreationException
-