Top Inners Fields Constructors Methods
org.bouncycastle.cms.jcajce

public Class JceCMSMacCalculatorBuilder

extends Object
Class Inheritance
Imports
java.io.OutputStream, java.security.AlgorithmParameters, .Provider, .SecureRandom, javax.crypto.KeyGenerator, .Mac, .SecretKey, org.bouncycastle.asn1.ASN1ObjectIdentifier, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.cms.CMSException, org.bouncycastle.jcajce.io.MacOutputStream, org.bouncycastle.operator.GenericKey, .MacCalculator, org.bouncycastle.operator.jcajce.JceGenericKey

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private AlgorithmParameters
private EnvelopedDataHelper
private final int
private final ASN1ObjectIdentifier
private SecureRandom

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public MacCalculator
public JceCMSMacCalculatorBuilder

Returns:

the current builder instance.
setAlgorithmParameters
(AlgorithmParameters
algorithmParameters for MAC initialisation.
algorithmParameters
)

Provide a set of algorithm parameters for the content MAC calculator to use.

public JceCMSMacCalculatorBuilder

Returns:

the current builder instance.
setProvider
(Provider
the provider object to use for MAC and default parameters creation.
provider
)

Set the provider to use for content encryption.

public JceCMSMacCalculatorBuilder

Returns:

the current builder instance.
setProvider
(String
the name of the provider to use for MAC and default parameters creation.
providerName
)

Set the provider to use for content encryption (by name)

public JceCMSMacCalculatorBuilder

Returns:

the current builder instance.
setSecureRandom
(SecureRandom
the secure random to use.
random
)

Provide a specified source of randomness to be used for session key and IV/nonce generation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

algorithmParametersback to summary
private AlgorithmParameters algorithmParameters
helperback to summary
private EnvelopedDataHelper helper
keySizeback to summary
private final int keySize
macOIDback to summary
private final ASN1ObjectIdentifier macOID
randomback to summary
private SecureRandom random

Constructor Detail

JceCMSMacCalculatorBuilderback to summary
public JceCMSMacCalculatorBuilder(ASN1ObjectIdentifier macOID)
JceCMSMacCalculatorBuilderback to summary
public JceCMSMacCalculatorBuilder(ASN1ObjectIdentifier macOID, int keySize)

Method Detail

buildback to summary
public MacCalculator build() throws CMSException
setAlgorithmParametersback to summary
public JceCMSMacCalculatorBuilder setAlgorithmParameters(AlgorithmParameters algorithmParameters)

Provide a set of algorithm parameters for the content MAC calculator to use.

Parameters
algorithmParameters:AlgorithmParameters

algorithmParameters for MAC initialisation.

Returns:JceCMSMacCalculatorBuilder

the current builder instance.

setProviderback to summary
public JceCMSMacCalculatorBuilder setProvider(Provider provider)

Set the provider to use for content encryption.

Parameters
provider:Provider

the provider object to use for MAC and default parameters creation.

Returns:JceCMSMacCalculatorBuilder

the current builder instance.

setProviderback to summary
public JceCMSMacCalculatorBuilder setProvider(String providerName)

Set the provider to use for content encryption (by name)

Parameters
providerName:String

the name of the provider to use for MAC and default parameters creation.

Returns:JceCMSMacCalculatorBuilder

the current builder instance.

setSecureRandomback to summary
public JceCMSMacCalculatorBuilder setSecureRandom(SecureRandom random)

Provide a specified source of randomness to be used for session key and IV/nonce generation.

Parameters
random:SecureRandom

the secure random to use.

Returns:JceCMSMacCalculatorBuilder

the current builder instance.

org.bouncycastle.cms.jcajce back to summary

private Class JceCMSMacCalculatorBuilder.CMSMacCalculator

extends Object
implements MacCalculator
Class Inheritance
  • java.lang.Object
  • org.bouncycastle.cms.jcajce.JceCMSMacCalculatorBuilder.CMSMacCalculator
All Implemented Interfaces
org.bouncycastle.operator.MacCalculator

Field Summary

Modifier and TypeField and Description
private AlgorithmIdentifier
private SecretKey
private Mac

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public AlgorithmIdentifier
public GenericKey
getKey()

Implements org.bouncycastle.operator.MacCalculator.getKey.

Return the key used for calculating the MAC.

public byte[]
getMac()

Implements org.bouncycastle.operator.MacCalculator.getMac.

Return the calculated MAC based on what has been written to the stream.

public OutputStream
getOutputStream()

Implements org.bouncycastle.operator.MacCalculator.getOutputStream.

Returns a stream that will accept data for the purpose of calculating the MAC for later verification.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

algorithmIdentifierback to summary
private AlgorithmIdentifier algorithmIdentifier
encKeyback to summary
private SecretKey encKey
macback to summary
private Mac mac

Constructor Detail

CMSMacCalculatorback to summary
pack-priv CMSMacCalculator(ASN1ObjectIdentifier macOID, int keySize, AlgorithmParameters params, SecureRandom random) throws CMSException

Method Detail

getAlgorithmIdentifierback to summary
public AlgorithmIdentifier getAlgorithmIdentifier()

Implements org.bouncycastle.operator.MacCalculator.getAlgorithmIdentifier.

getKeyback to summary
public GenericKey getKey()

Implements org.bouncycastle.operator.MacCalculator.getKey.

Doc from org.bouncycastle.operator.MacCalculator.getKey.

Return the key used for calculating the MAC.

Returns:GenericKey

the MAC key.

getMacback to summary
public byte[] getMac()

Implements org.bouncycastle.operator.MacCalculator.getMac.

Doc from org.bouncycastle.operator.MacCalculator.getMac.

Return the calculated MAC based on what has been written to the stream.

Returns:byte[]

calculated MAC.

getOutputStreamback to summary
public OutputStream getOutputStream()

Implements org.bouncycastle.operator.MacCalculator.getOutputStream.

Doc from org.bouncycastle.operator.MacCalculator.getOutputStream.

Returns a stream that will accept data for the purpose of calculating the MAC for later verification. Use org.bouncycastle.util.io.TeeOutputStream if you want to accumulate the data on the fly as well.

Returns:OutputStream

an OutputStream