Class CMSEncryptedData
java.lang.Object
org.bouncycastle.cms.CMSEncryptedData
-
Constructor Summary
ConstructorsConstructorDescriptionCMSEncryptedData(byte[] encryptedData) Create a CMSEncryptedData object from its encoding.CMSEncryptedData(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
Modifier and TypeMethodDescriptionbyte[]getContent(InputDecryptorProvider inputDecryptorProvider) getContentStream(InputDecryptorProvider inputDecryptorProvider) org.bouncycastle.asn1.cms.ContentInforeturn the ContentInfo
-
Constructor Details
-
CMSEncryptedData
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
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 Details
-
getContent
- Throws:
CMSException
-
getContentStream
public CMSTypedStream getContentStream(InputDecryptorProvider inputDecryptorProvider) throws CMSException - Throws:
CMSException
-
toASN1Structure
public org.bouncycastle.asn1.cms.ContentInfo toASN1Structure()return the ContentInfo
-