summary refs log tree commit diff
path: root/crypto/src/cms/CMSSignedData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/cms/CMSSignedData.cs')
-rw-r--r--crypto/src/cms/CMSSignedData.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/crypto/src/cms/CMSSignedData.cs b/crypto/src/cms/CMSSignedData.cs
index a19fe27ab..77da9b95d 100644
--- a/crypto/src/cms/CMSSignedData.cs
+++ b/crypto/src/cms/CMSSignedData.cs
@@ -5,6 +5,7 @@ using System.IO;
 using Org.BouncyCastle.Asn1;
 using Org.BouncyCastle.Asn1.Cms;
 using Org.BouncyCastle.Asn1.X509;
+using Org.BouncyCastle.cms;
 using Org.BouncyCastle.Operators.Utilities;
 using Org.BouncyCastle.Utilities.Collections;
 using Org.BouncyCastle.X509;
@@ -115,8 +116,16 @@ namespace Org.BouncyCastle.Cms
 			//
 			if (signedData.EncapContentInfo.Content != null)
 			{
-				this.signedContent = new CmsProcessableByteArray(
-					((Asn1OctetString)signedData.EncapContentInfo.Content).GetOctets());
+				if (signedData.EncapContentInfo.Content is Asn1OctetString)
+				{
+					signedContent = new CmsProcessableByteArray(
+						((Asn1OctetString)(signedData.EncapContentInfo.Content)).GetOctets());
+				}
+				else
+				{
+					signedContent = new Pkcs7ProcessableObject(signedData.EncapContentInfo.ContentType,
+						signedData.EncapContentInfo.Content);
+				}
 			}
 //			else
 //			{