Package org.bouncycastle.cms
Class CMSEncryptedData
- java.lang.Object
-
- org.bouncycastle.cms.CMSEncryptedData
-
public class CMSEncryptedData extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description CMSEncryptedData(byte[] encryptedData)Create a CMSEncryptedData object from its encoding.CMSEncryptedData(java.io.InputStream encryptedData)Create a CMSEncryptedData object from a stream.CMSEncryptedData(org.bouncycastle.asn1.cms.ContentInfo contentInfo)Create a CMSEncryptedData object from an already-parsed ContentInfo.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getContent(InputDecryptorProvider inputDecryptorProvider)CMSTypedStreamgetContentStream(InputDecryptorProvider inputDecryptorProvider)org.bouncycastle.asn1.cms.ContentInfotoASN1Structure()return the ContentInfo
-
-
-
Constructor Detail
-
CMSEncryptedData
public CMSEncryptedData(byte[] encryptedData) throws CMSExceptionCreate 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 CMSExceptionCreate 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
-
-