Package org.bouncycastle.cms.jcajce
Class JceCMSContentEncryptorBuilder
java.lang.Object
org.bouncycastle.cms.jcajce.JceCMSContentEncryptorBuilder
Builder for the content encryptor in EnvelopedData - used to encrypt the actual transmitted content.
-
Constructor Summary
ConstructorDescriptionJceCMSContentEncryptorBuilder
(org.bouncycastle.asn1.ASN1ObjectIdentifier encryptionOID) JceCMSContentEncryptorBuilder
(org.bouncycastle.asn1.ASN1ObjectIdentifier encryptionOID, int keySize) JceCMSContentEncryptorBuilder
(org.bouncycastle.asn1.x509.AlgorithmIdentifier encryptionAlgId) Constructor for a content encryptor builder based on an algorithm identifier and its contained parameters. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
setAlgorithmParameters
(AlgorithmParameters algorithmParameters) Provide a set of algorithm parameters for the content encryption cipher to use.setEnableSha256HKdf
(boolean useSha256Hkdf) setProvider
(String providerName) Set the provider to use for content encryption (by name)setProvider
(Provider provider) Set the provider to use for content encryption.setSecureRandom
(SecureRandom random) Provide a specified source of randomness to be used for session key and IV/nonce generation.
-
Constructor Details
-
JceCMSContentEncryptorBuilder
public JceCMSContentEncryptorBuilder(org.bouncycastle.asn1.ASN1ObjectIdentifier encryptionOID) -
JceCMSContentEncryptorBuilder
public JceCMSContentEncryptorBuilder(org.bouncycastle.asn1.ASN1ObjectIdentifier encryptionOID, int keySize) -
JceCMSContentEncryptorBuilder
public JceCMSContentEncryptorBuilder(org.bouncycastle.asn1.x509.AlgorithmIdentifier encryptionAlgId) Constructor for a content encryptor builder based on an algorithm identifier and its contained parameters.- Parameters:
encryptionAlgId
- the full algorithm identifier for the encryption.
-
-
Method Details
-
setEnableSha256HKdf
-
setProvider
Set the provider to use for content encryption.- Parameters:
provider
- the provider object to use for cipher and default parameters creation.- Returns:
- the current builder instance.
-
setProvider
Set the provider to use for content encryption (by name)- Parameters:
providerName
- the name of the provider to use for cipher and default parameters creation.- Returns:
- the current builder instance.
-
setSecureRandom
Provide a specified source of randomness to be used for session key and IV/nonce generation.- Parameters:
random
- the secure random to use.- Returns:
- the current builder instance.
-
setAlgorithmParameters
public JceCMSContentEncryptorBuilder setAlgorithmParameters(AlgorithmParameters algorithmParameters) Provide a set of algorithm parameters for the content encryption cipher to use.- Parameters:
algorithmParameters
- algorithmParameters for content encryption.- Returns:
- the current builder instance.
-
build
- Throws:
CMSException
-