public class

CMSEnvelopedDataStreamGenerator

extends CMSEnvelopedGenerator
java.lang.Object
   ↳ org.bouncycastle.cms.CMSEnvelopedGenerator
     ↳ org.bouncycastle.cms.CMSEnvelopedDataStreamGenerator

Class Overview

General class for generating a CMS enveloped-data message stream.

A simple example of usage.

      CMSEnvelopedDataStreamGenerator edGen = new CMSEnvelopedDataStreamGenerator();

      edGen.addRecipientInfoGenerator(new JceKeyTransRecipientInfoGenerator(recipientCert).setProvider("BC"));

      ByteArrayOutputStream  bOut = new ByteArrayOutputStream();
      
      OutputStream out = edGen.open(
                              bOut, new JceCMSContentEncryptorBuilder(CMSAlgorithm.DES_EDE3_CBC)
                                              .setProvider("BC").build());
      out.write(data);
      
      out.close();
 

Summary

[Expand]
Inherited Constants
From class org.bouncycastle.cms.CMSEnvelopedGenerator
[Expand]
Inherited Fields
From class org.bouncycastle.cms.CMSEnvelopedGenerator
Public Constructors
CMSEnvelopedDataStreamGenerator()
base constructor
CMSEnvelopedDataStreamGenerator(SecureRandom rand)
constructor allowing specific source of randomness
Public Methods
OutputStream open(OutputStream out, String encryptionOID, int keySize, String provider)
This method is deprecated. No replacement.
OutputStream open(OutputStream out, OutputEncryptor encryptor)
generate an enveloped object that contains an CMS Enveloped Data object using the given encryptor.
OutputStream open(ASN1ObjectIdentifier dataType, OutputStream out, OutputEncryptor encryptor)
generate an enveloped object that contains an CMS Enveloped Data object using the given encryptor and marking the data as being of the passed in type.
OutputStream open(OutputStream out, String encryptionOID, Provider provider)
This method is deprecated. No replacement.
OutputStream open(OutputStream out, String encryptionOID, String provider)
This method is deprecated. No replacement.
OutputStream open(OutputStream out, String encryptionOID, int keySize, Provider provider)
This method is deprecated. No replacement.
void setBEREncodeRecipients(boolean berEncodeRecipientSet)
Use a BER Set to store the recipient information
void setBufferSize(int bufferSize)
Set the underlying string size for encapsulated data
Protected Methods
OutputStream open(OutputStream out, ASN1EncodableVector recipientInfos, OutputEncryptor encryptor)
OutputStream open(OutputStream out, String encryptionOID, SecretKey encKey, AlgorithmParameters params, ASN1EncodableVector recipientInfos, Provider provider)
OutputStream open(OutputStream out, String encryptionOID, SecretKey encKey, AlgorithmParameters params, ASN1EncodableVector recipientInfos, String provider)
OutputStream open(ASN1ObjectIdentifier dataType, OutputStream out, ASN1EncodableVector recipientInfos, OutputEncryptor encryptor)
[Expand]
Inherited Methods
From class org.bouncycastle.cms.CMSEnvelopedGenerator
From class java.lang.Object

Public Constructors

public CMSEnvelopedDataStreamGenerator ()

base constructor

public CMSEnvelopedDataStreamGenerator (SecureRandom rand)

constructor allowing specific source of randomness

Parameters
rand instance of SecureRandom to use

Public Methods

public OutputStream open (OutputStream out, String encryptionOID, int keySize, String provider)

This method is deprecated.
No replacement.

generate an enveloped object that contains an CMS Enveloped Data object using the given provider.

public OutputStream open (OutputStream out, OutputEncryptor encryptor)

generate an enveloped object that contains an CMS Enveloped Data object using the given encryptor.

public OutputStream open (ASN1ObjectIdentifier dataType, OutputStream out, OutputEncryptor encryptor)

generate an enveloped object that contains an CMS Enveloped Data object using the given encryptor and marking the data as being of the passed in type.

public OutputStream open (OutputStream out, String encryptionOID, Provider provider)

This method is deprecated.
No replacement.

public OutputStream open (OutputStream out, String encryptionOID, String provider)

This method is deprecated.
No replacement.

generate an enveloped object that contains an CMS Enveloped Data object using the given provider.

public OutputStream open (OutputStream out, String encryptionOID, int keySize, Provider provider)

This method is deprecated.
No replacement.

generate an enveloped object that contains an CMS Enveloped Data object using the given provider.

public void setBEREncodeRecipients (boolean berEncodeRecipientSet)

Use a BER Set to store the recipient information

public void setBufferSize (int bufferSize)

Set the underlying string size for encapsulated data

Parameters
bufferSize length of octet strings to buffer the data.

Protected Methods

protected OutputStream open (OutputStream out, ASN1EncodableVector recipientInfos, OutputEncryptor encryptor)

Throws
CMSException

protected OutputStream open (OutputStream out, String encryptionOID, SecretKey encKey, AlgorithmParameters params, ASN1EncodableVector recipientInfos, Provider provider)

protected OutputStream open (OutputStream out, String encryptionOID, SecretKey encKey, AlgorithmParameters params, ASN1EncodableVector recipientInfos, String provider)

protected OutputStream open (ASN1ObjectIdentifier dataType, OutputStream out, ASN1EncodableVector recipientInfos, OutputEncryptor encryptor)

Throws
IOException