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
providerIPKMacPrimitivesProvider
PKMacBuilder(IPKMacPrimitivesProvider, AlgorithmIdentifier, AlgorithmIdentifier)
Create.
public PKMacBuilder(IPKMacPrimitivesProvider provider, AlgorithmIdentifier digestAlgorithmIdentifier, AlgorithmIdentifier macAlgorithmIdentifier)
Parameters
providerIPKMacPrimitivesProviderThe Mac provider
digestAlgorithmIdentifierAlgorithmIdentifierDigest Algorithm Id
macAlgorithmIdentifierAlgorithmIdentifierMac Algorithm Id
PKMacBuilder(IPKMacPrimitivesProvider, int)
Create a PKMAC builder enforcing a ceiling on the maximum iteration count.
public PKMacBuilder(IPKMacPrimitivesProvider provider, int maxIterations)
Parameters
providerIPKMacPrimitivesProvidersupporting calculator
maxIterationsintmax allowable value for iteration count.
Methods
Build(char[])
Build an IMacFactory.
public IMacFactory Build(char[] password)
Parameters
passwordchar[]The password.
Returns
- IMacFactory
IMacFactory
Build(ReadOnlySpan<char>)
public IMacFactory Build(ReadOnlySpan<char> password)
Parameters
passwordReadOnlySpan<char>
Returns
Get(AlgorithmIdentifier, char[])
public IMacFactory Get(AlgorithmIdentifier algorithm, char[] password)
Parameters
algorithmAlgorithmIdentifierpasswordchar[]
Returns
Get(AlgorithmIdentifier, ReadOnlySpan<char>)
public IMacFactory Get(AlgorithmIdentifier algorithm, ReadOnlySpan<char> password)
Parameters
algorithmAlgorithmIdentifierpasswordReadOnlySpan<char>
Returns
SetIterationCount(int)
Set the iteration count.
public PKMacBuilder SetIterationCount(int iterationCount)
Parameters
iterationCountintthe iteration count.
Returns
- PKMacBuilder
this
Exceptions
- ArgumentException
if iteration count is less than 100
SetParameters(PbmParameter)
Set PbmParameters
public PKMacBuilder SetParameters(PbmParameter parameters)
Parameters
parametersPbmParameterThe parameters.
Returns
- PKMacBuilder
this
SetSaltLength(int)
public PKMacBuilder SetSaltLength(int saltLength)
Parameters
saltLengthint
Returns
SetSecureRandom(SecureRandom)
The Secure random
public PKMacBuilder SetSecureRandom(SecureRandom random)
Parameters
randomSecureRandomThe random.
Returns
- PKMacBuilder
this