Bouncy Castle Cryptography Library 1.85

org.bouncycastle.pkcs.bc
Class BcPKCS12MacCalculatorBuilder

java.lang.Object
  extended byorg.bouncycastle.pkcs.bc.BcPKCS12MacCalculatorBuilder
All Implemented Interfaces:
PKCS12MacCalculatorBuilder

public class BcPKCS12MacCalculatorBuilder
extends java.lang.Object
implements PKCS12MacCalculatorBuilder

Lightweight builder for the password-based MAC calculator used to protect the integrity of a PKCS#12 PFX (RFC 7292). Defaults to SHA-1 with an iteration count of 1024.


Constructor Summary
BcPKCS12MacCalculatorBuilder()
          Default constructor — produces a SHA-1 based MAC builder.
BcPKCS12MacCalculatorBuilder(org.bouncycastle.crypto.ExtendedDigest digest, org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier)
          Construct a MAC builder backed by a specific digest.
 
Method Summary
 MacCalculator build(char[] password)
           
 org.bouncycastle.asn1.x509.AlgorithmIdentifier getDigestAlgorithmIdentifier()
           
 BcPKCS12MacCalculatorBuilder setIterationCount(int iterationCount)
          Override the iteration count used by the PKCS#12 key derivation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BcPKCS12MacCalculatorBuilder

public BcPKCS12MacCalculatorBuilder()
Default constructor — produces a SHA-1 based MAC builder.


BcPKCS12MacCalculatorBuilder

public BcPKCS12MacCalculatorBuilder(org.bouncycastle.crypto.ExtendedDigest digest,
                                    org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier)
Construct a MAC builder backed by a specific digest.

Parameters:
digest - the lightweight digest implementation to drive the HMAC.
algorithmIdentifier - the algorithm identifier describing .
Method Detail

setIterationCount

public BcPKCS12MacCalculatorBuilder setIterationCount(int iterationCount)
Override the iteration count used by the PKCS#12 key derivation. Defaults to 1024.

Parameters:
iterationCount - the iteration count.
Returns:
this builder.

getDigestAlgorithmIdentifier

public org.bouncycastle.asn1.x509.AlgorithmIdentifier getDigestAlgorithmIdentifier()
Specified by:
getDigestAlgorithmIdentifier in interface PKCS12MacCalculatorBuilder

build

public MacCalculator build(char[] password)
Specified by:
build in interface PKCS12MacCalculatorBuilder

Bouncy Castle Cryptography Library 1.85