github - first cut of AuthEnvelopedData (RFC 5083) parsing.
package org.bouncycastle.cms;
+import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
/**
* containing class for an CMS AuthEnveloped Data object
*/
-class CMSAuthEnvelopedData
+public class CMSAuthEnvelopedData
{
RecipientInformationStore recipientInfoStore;
ContentInfo contentInfo;
@@ -52,15 +53,14 @@ public CMSAuthEnvelopedData(ContentInfo contentInfo) throws CMSException
//
EncryptedContentInfo authEncInfo = authEnvData.getAuthEncryptedContentInfo();
this.authEncAlg = authEncInfo.getContentEncryptionAlgorithm();
-// final CMSProcessable processable = new CMSProcessableByteArray(
-// authEncInfo.getEncryptedContent().getOctets());
+
CMSSecureReadable secureReadable = new CMSSecureReadable()
{
public InputStream getInputStream()
throws IOException, CMSException
{
- return null;
+ return new ByteArrayInputStream(authEncInfo.getEncryptedContent().getOctets());
}
};
@@ -75,4 +75,12 @@ public InputStream getInputStream()
this.mac = authEnvData.getMac().getOctets();
this.unauthAttrs = authEnvData.getUnauthAttrs();
}
+
+ /**
+ * return a store of the intended recipients for this message
+ */
+ public RecipientInformationStore getRecipientInfos()
+ {
+ return recipientInfoStore;
+ }
}
