Bouncy Castle Cryptography Library 1.87

org.bouncycastle.cms
Class CMSEncryptedData

java.lang.Object
  extended byorg.bouncycastle.cms.CMSEncryptedData

public class CMSEncryptedData
extends java.lang.Object


Constructor Summary
CMSEncryptedData(byte[] encryptedData)
          Create a CMSEncryptedData object from its encoding.
CMSEncryptedData(org.bouncycastle.asn1.cms.ContentInfo contentInfo)
          Create a CMSEncryptedData object from an already-parsed ContentInfo.
CMSEncryptedData(java.io.InputStream encryptedData)
          Create a CMSEncryptedData object from a stream.
 
Method Summary
 byte[] getContent(InputDecryptorProvider inputDecryptorProvider)
           
 CMSTypedStream getContentStream(InputDecryptorProvider inputDecryptorProvider)
           
 org.bouncycastle.asn1.cms.ContentInfo toASN1Structure()
          return the ContentInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CMSEncryptedData

public CMSEncryptedData(byte[] encryptedData)
                 throws CMSException
Create a CMSEncryptedData object from its encoding.

Parameters:
encryptedData - the complete encoding of the EncryptedData structure (a CMS ContentInfo). The array must hold the entire encoding and nothing extra - trailing bytes beyond the EncryptedData are not permitted.
Throws:
CMSException - if the encoding cannot be parsed as an EncryptedData.

CMSEncryptedData

public CMSEncryptedData(java.io.InputStream encryptedData)
                 throws CMSException
Create a CMSEncryptedData object from a stream.

Parameters:
encryptedData - a stream positioned at the start of the EncryptedData encoding (a CMS ContentInfo).
Throws:
CMSException - if the encoding cannot be parsed as an EncryptedData.

CMSEncryptedData

public CMSEncryptedData(org.bouncycastle.asn1.cms.ContentInfo contentInfo)
Create a CMSEncryptedData object from an already-parsed ContentInfo.

Note: unlike the sibling CMS container constructors this one is not declared to throw CMSException; malformed inner content surfaces as an IllegalArgumentException.

Parameters:
contentInfo - the ContentInfo carrying the EncryptedData.
Method Detail

getContent

public byte[] getContent(InputDecryptorProvider inputDecryptorProvider)
                  throws CMSException
Throws:
CMSException

getContentStream

public CMSTypedStream getContentStream(InputDecryptorProvider inputDecryptorProvider)
                                throws CMSException
Throws:
CMSException

toASN1Structure

public org.bouncycastle.asn1.cms.ContentInfo toASN1Structure()
return the ContentInfo


Bouncy Castle Cryptography Library 1.87