|
Bouncy Castle Cryptography Library 1.87 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.bouncycastle.cms.jcajce.JceCMSMacCalculatorBuilder
Builder for the MAC calculator of a CMS AuthenticatedData message.
Prefer an HMAC, such as , or KMAC. The CBC-MACs
named by CMSAlgorithm.DES_EDE3_CBC and
CMSAlgorithm.RC2_CBC are kept for compatibility: they produce a
4-byte MAC, and when the message has no authenticated attributes the MAC covers the content alone,
so any IV in the macAlgorithm parameters is unprotected. Unless parameters are set with
setAlgorithmParameters(AlgorithmParameters) these are therefore written with a zero IV,
and a non-zero IV is refused for a message without authenticated attributes, on generation and on
receipt (see ).
| Constructor Summary | |
JceCMSMacCalculatorBuilder(org.bouncycastle.asn1.ASN1ObjectIdentifier macOID)
|
|
JceCMSMacCalculatorBuilder(org.bouncycastle.asn1.ASN1ObjectIdentifier macOID,
int keySize)
|
|
| Method Summary | |
MacCalculator |
build()
|
JceCMSMacCalculatorBuilder |
setAlgorithmParameters(java.security.AlgorithmParameters algorithmParameters)
Provide a set of algorithm parameters for the content MAC calculator to use. |
JceCMSMacCalculatorBuilder |
setProvider(java.security.Provider provider)
Set the provider to use for content encryption. |
JceCMSMacCalculatorBuilder |
setProvider(java.lang.String providerName)
Set the provider to use for content encryption (by name) |
JceCMSMacCalculatorBuilder |
setSecureRandom(java.security.SecureRandom random)
Provide a specified source of randomness to be used for session key and IV/nonce generation. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JceCMSMacCalculatorBuilder(org.bouncycastle.asn1.ASN1ObjectIdentifier macOID)
public JceCMSMacCalculatorBuilder(org.bouncycastle.asn1.ASN1ObjectIdentifier macOID,
int keySize)
| Method Detail |
public JceCMSMacCalculatorBuilder setProvider(java.security.Provider provider)
provider - the provider object to use for MAC and default parameters creation.
public JceCMSMacCalculatorBuilder setProvider(java.lang.String providerName)
providerName - the name of the provider to use for MAC and default parameters creation.
public JceCMSMacCalculatorBuilder setSecureRandom(java.security.SecureRandom random)
random - the secure random to use.
public JceCMSMacCalculatorBuilder setAlgorithmParameters(java.security.AlgorithmParameters algorithmParameters)
For a CBC-MAC (des-ede3-cbc or rc2-cbc) parameters carrying a non-zero IV can only be used for a message with authenticated attributes, which bind the content; without them the generator refuses the IV, as it is not covered by the MAC.
algorithmParameters - algorithmParameters for MAC initialisation.
public MacCalculator build()
throws CMSException
CMSException
|
Bouncy Castle Cryptography Library 1.87 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||