Class CMSEncryptedData


  • public class CMSEncryptedData
    extends java.lang.Object
    • 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.