Top Description Fields Constructors Methods
org.bouncycastle.pkcs.jcajce

public Class JcePBMac1CalculatorBuilder

extends Object
Class Inheritance
Imports
java.io.OutputStream, java.security.Provider, .SecureRandom, javax.crypto.Mac, .SecretKey, .SecretKeyFactory, org.bouncycastle.asn1.DERNull, org.bouncycastle.asn1.nist.NISTObjectIdentifiers, org.bouncycastle.asn1.pkcs.PBKDF2Params, .PBMAC1Params, .PKCSObjectIdentifiers, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.jcajce.io.MacOutputStream, org.bouncycastle.jcajce.spec.PBKDF2KeySpec, org.bouncycastle.jcajce.util.DefaultJcaJceHelper, .JcaJceHelper, .NamedJcaJceHelper, .ProviderJcaJceHelper, org.bouncycastle.operator.DefaultMacAlgorithmIdentifierFinder, .GenericKey, .MacAlgorithmIdentifierFinder, .MacCalculator, .OperatorCreationException, org.bouncycastle.util.BigIntegers

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 TypeField and Description
private static final DefaultMacAlgorithmIdentifierFinder
private JcaJceHelper
private int
private int
private AlgorithmIdentifier
private PBKDF2Params
private AlgorithmIdentifier
public static final AlgorithmIdentifier
public static final AlgorithmIdentifier
public static final AlgorithmIdentifier
public static final AlgorithmIdentifier
public static final AlgorithmIdentifier
public static final AlgorithmIdentifier
public static final AlgorithmIdentifier
public static final AlgorithmIdentifier
private SecureRandom
private byte[]
private int

Constructor Summary

AccessConstructor and Description
public
JcePBMac1CalculatorBuilder(String
name of the MAC algorithm.
macAlgorithm
,
int
the key size in bits.
keySize
)

Base constructor - MAC name and key size.

public
JcePBMac1CalculatorBuilder(String
name of the MAC algorithm.
macAlgorithm
,
int
the key size in bits.
keySize
,
MacAlgorithmIdentifierFinder
an AlgorithmIdentifier finder containing the specified MAC name.
algIdFinder
)

Base constructor - MAC name and key size with a custom AlgorithmIdentifier finder for the MAC algorithm.

public
JcePBMac1CalculatorBuilder(PBMAC1Params
the ASN.1 parameters for the MAC calculator we want to create.
pbeMacParams
)

Base constructor from an ASN.1 parameter set.

Method Summary

Modifier and TypeMethod and Description
public MacCalculator
build(final char[] password)

pack-priv JcePBMac1CalculatorBuilder
public JcePBMac1CalculatorBuilder
setIterationCount(int iterationCount)

public JcePBMac1CalculatorBuilder
public JcePBMac1CalculatorBuilder
public JcePBMac1CalculatorBuilder
setProvider(String providerName)

public JcePBMac1CalculatorBuilder
public JcePBMac1CalculatorBuilder
setSalt(byte[] salt)

public JcePBMac1CalculatorBuilder
setSaltLength(int saltLength)

Set the length of the salt in bytes.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultFinderback to summary
private static final DefaultMacAlgorithmIdentifierFinder defaultFinder
helperback to summary
private JcaJceHelper helper
iterationCountback to summary
private int iterationCount
keySizeback to summary
private int keySize
macAlgorithmback to summary
private AlgorithmIdentifier macAlgorithm
pbeParamsback to summary
private PBKDF2Params pbeParams
prfback to summary
private AlgorithmIdentifier prf
PRF_SHA224back to summary
public static final AlgorithmIdentifier PRF_SHA224
PRF_SHA256back to summary
public static final AlgorithmIdentifier PRF_SHA256
PRF_SHA384back to summary
public static final AlgorithmIdentifier PRF_SHA384
PRF_SHA3_224back to summary
public static final AlgorithmIdentifier PRF_SHA3_224
PRF_SHA3_256back to summary
public static final AlgorithmIdentifier PRF_SHA3_256
PRF_SHA3_384back to summary
public static final AlgorithmIdentifier PRF_SHA3_384
PRF_SHA3_512back to summary
public static final AlgorithmIdentifier PRF_SHA3_512
PRF_SHA512back to summary
public static final AlgorithmIdentifier PRF_SHA512
randomback to summary
private SecureRandom random
saltback to summary
private byte[] salt
saltLengthback to summary
private int saltLength

Constructor Detail

JcePBMac1CalculatorBuilderback to summary
public JcePBMac1CalculatorBuilder(String macAlgorithm, int keySize)

Base constructor - MAC name and key size.

Parameters
macAlgorithm:String

name of the MAC algorithm.

keySize:int

the key size in bits.

JcePBMac1CalculatorBuilderback to summary
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:String

name of the MAC algorithm.

keySize:int

the key size in bits.

algIdFinder:MacAlgorithmIdentifierFinder

an AlgorithmIdentifier finder containing the specified MAC name.

JcePBMac1CalculatorBuilderback to summary
public JcePBMac1CalculatorBuilder(PBMAC1Params pbeMacParams)

Base constructor from an ASN.1 parameter set. See RFC 8108 for details.

Parameters
pbeMacParams:PBMAC1Params

the ASN.1 parameters for the MAC calculator we want to create.

Method Detail

buildback to summary
public MacCalculator build(final char[] password) throws OperatorCreationException
setHelperback to summary
pack-priv JcePBMac1CalculatorBuilder setHelper(JcaJceHelper helper)
setIterationCountback to summary
public JcePBMac1CalculatorBuilder setIterationCount(int iterationCount)
setPrfback to summary
public JcePBMac1CalculatorBuilder setPrf(AlgorithmIdentifier prf)
setProviderback to summary
public JcePBMac1CalculatorBuilder setProvider(Provider provider)
setProviderback to summary
public JcePBMac1CalculatorBuilder setProvider(String providerName)
setRandomback to summary
public JcePBMac1CalculatorBuilder setRandom(SecureRandom random)
setSaltback to summary
public JcePBMac1CalculatorBuilder setSalt(byte[] salt)
setSaltLengthback to summary
public JcePBMac1CalculatorBuilder setSaltLength(int saltLength)

Set the length of the salt in bytes.