Table of Contents

Class PKMacBuilder

Namespace
Org.BouncyCastle.Crmf
Assembly
BouncyCastle.Cryptography.dll
public class PKMacBuilder
Inheritance
PKMacBuilder
Inherited Members

Constructors

PKMacBuilder()

Default, IterationCount = 1000, OIW=IdSha1, Mac=HmacSHA1

public PKMacBuilder()

PKMacBuilder(IPKMacPrimitivesProvider)

Defaults with IPKMacPrimitivesProvider

public PKMacBuilder(IPKMacPrimitivesProvider provider)

Parameters

provider IPKMacPrimitivesProvider

PKMacBuilder(IPKMacPrimitivesProvider, AlgorithmIdentifier, AlgorithmIdentifier)

Create.

public PKMacBuilder(IPKMacPrimitivesProvider provider, AlgorithmIdentifier digestAlgorithmIdentifier, AlgorithmIdentifier macAlgorithmIdentifier)

Parameters

provider IPKMacPrimitivesProvider

The Mac provider

digestAlgorithmIdentifier AlgorithmIdentifier

Digest Algorithm Id

macAlgorithmIdentifier AlgorithmIdentifier

Mac Algorithm Id

PKMacBuilder(IPKMacPrimitivesProvider, int)

Create a PKMAC builder enforcing a ceiling on the maximum iteration count.

public PKMacBuilder(IPKMacPrimitivesProvider provider, int maxIterations)

Parameters

provider IPKMacPrimitivesProvider

supporting calculator

maxIterations int

max allowable value for iteration count.

Methods

Build(char[])

Build an IMacFactory.

public IMacFactory Build(char[] password)

Parameters

password char[]

The password.

Returns

IMacFactory

IMacFactory

Build(ReadOnlySpan<char>)

public IMacFactory Build(ReadOnlySpan<char> password)

Parameters

password ReadOnlySpan<char>

Returns

IMacFactory

Get(AlgorithmIdentifier, char[])

public IMacFactory Get(AlgorithmIdentifier algorithm, char[] password)

Parameters

algorithm AlgorithmIdentifier
password char[]

Returns

IMacFactory

Get(AlgorithmIdentifier, ReadOnlySpan<char>)

public IMacFactory Get(AlgorithmIdentifier algorithm, ReadOnlySpan<char> password)

Parameters

algorithm AlgorithmIdentifier
password ReadOnlySpan<char>

Returns

IMacFactory

SetIterationCount(int)

Set the iteration count.

public PKMacBuilder SetIterationCount(int iterationCount)

Parameters

iterationCount int

the iteration count.

Returns

PKMacBuilder

this

Exceptions

ArgumentException

if iteration count is less than 100

SetParameters(PbmParameter)

Set PbmParameters

public PKMacBuilder SetParameters(PbmParameter parameters)

Parameters

parameters PbmParameter

The parameters.

Returns

PKMacBuilder

this

SetSaltLength(int)

public PKMacBuilder SetSaltLength(int saltLength)

Parameters

saltLength int

Returns

PKMacBuilder

SetSecureRandom(SecureRandom)

The Secure random

public PKMacBuilder SetSecureRandom(SecureRandom random)

Parameters

random SecureRandom

The random.

Returns

PKMacBuilder

this