public class JcePBMac1CalculatorBuilder
extends java.lang.Object
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.
Modifier and Type | Field and Description |
---|---|
static org.bouncycastle.asn1.x509.AlgorithmIdentifier |
PRF_SHA224 |
static org.bouncycastle.asn1.x509.AlgorithmIdentifier |
PRF_SHA256 |
static org.bouncycastle.asn1.x509.AlgorithmIdentifier |
PRF_SHA3_224 |
static org.bouncycastle.asn1.x509.AlgorithmIdentifier |
PRF_SHA3_256 |
static org.bouncycastle.asn1.x509.AlgorithmIdentifier |
PRF_SHA3_384 |
static org.bouncycastle.asn1.x509.AlgorithmIdentifier |
PRF_SHA3_512 |
static org.bouncycastle.asn1.x509.AlgorithmIdentifier |
PRF_SHA384 |
static org.bouncycastle.asn1.x509.AlgorithmIdentifier |
PRF_SHA512 |
Constructor and Description |
---|
JcePBMac1CalculatorBuilder(org.bouncycastle.asn1.pkcs.PBMAC1Params pbeMacParams)
Base constructor from an ASN.1 parameter set.
|
JcePBMac1CalculatorBuilder(java.lang.String macAlgorithm,
int keySize)
Base constructor - MAC name and key size.
|
JcePBMac1CalculatorBuilder(java.lang.String macAlgorithm,
int keySize,
MacAlgorithmIdentifierFinder algIdFinder)
Base constructor - MAC name and key size with a custom AlgorithmIdentifier finder for the MAC algorithm.
|
Modifier and Type | Method and Description |
---|---|
MacCalculator |
build(char[] password) |
JcePBMac1CalculatorBuilder |
setIterationCount(int iterationCount) |
JcePBMac1CalculatorBuilder |
setPrf(org.bouncycastle.asn1.x509.AlgorithmIdentifier prf) |
JcePBMac1CalculatorBuilder |
setProvider(java.security.Provider provider) |
JcePBMac1CalculatorBuilder |
setProvider(java.lang.String providerName) |
JcePBMac1CalculatorBuilder |
setRandom(java.security.SecureRandom random) |
JcePBMac1CalculatorBuilder |
setSalt(byte[] salt) |
JcePBMac1CalculatorBuilder |
setSaltLength(int saltLength)
Set the length of the salt in bytes.
|
public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier PRF_SHA224
public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier PRF_SHA256
public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier PRF_SHA384
public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier PRF_SHA512
public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier PRF_SHA3_224
public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier PRF_SHA3_256
public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier PRF_SHA3_384
public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier PRF_SHA3_512
public JcePBMac1CalculatorBuilder(java.lang.String macAlgorithm, int keySize)
macAlgorithm
- name of the MAC algorithm.keySize
- the key size in bits.public JcePBMac1CalculatorBuilder(java.lang.String macAlgorithm, int keySize, MacAlgorithmIdentifierFinder algIdFinder)
macAlgorithm
- name of the MAC algorithm.keySize
- the key size in bits.algIdFinder
- an AlgorithmIdentifier finder containing the specified MAC name.public JcePBMac1CalculatorBuilder(org.bouncycastle.asn1.pkcs.PBMAC1Params pbeMacParams)
pbeMacParams
- the ASN.1 parameters for the MAC calculator we want to create.public JcePBMac1CalculatorBuilder setProvider(java.security.Provider provider)
public JcePBMac1CalculatorBuilder setProvider(java.lang.String providerName)
public JcePBMac1CalculatorBuilder setIterationCount(int iterationCount)
public JcePBMac1CalculatorBuilder setSaltLength(int saltLength)
saltLength
- public JcePBMac1CalculatorBuilder setSalt(byte[] salt)
public JcePBMac1CalculatorBuilder setRandom(java.security.SecureRandom random)
public JcePBMac1CalculatorBuilder setPrf(org.bouncycastle.asn1.x509.AlgorithmIdentifier prf)
public MacCalculator build(char[] password) throws OperatorCreationException
OperatorCreationException