Browse Source

2004-07-09 Sebastien Pouliot <[email protected]>

	* Removed old files (from 1.2 preview).

svn path=/trunk/mcs/; revision=30948
Sebastien Pouliot 21 years ago
parent
commit
3545dd5eff

+ 0 - 349
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/EnvelopedPkcs7Test.cs

@@ -1,349 +0,0 @@
-//
-// EnvelopedPkcs7Test.cs - NUnit tests for EnvelopedPkcs7
-//
-// Author:
-//	Sebastien Pouliot ([email protected])
-//
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-//
-
-#if NET_2_0
-
-using NUnit.Framework;
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Security.Cryptography;
-using System.Security.Cryptography.Pkcs;
-using System.Security.Cryptography.X509Certificates;
-
-namespace MonoTests.System.Security.Cryptography.Pkcs {
-
-	[TestFixture]
-	public class EnvelopedPkcs7Test : Assertion {
-
-		static byte[] asnNull = { 0x05, 0x00 };
-		static string tdesOid = "1.2.840.113549.3.7";
-		static string tdesName = "3des";
-		static string p7DataOid = "1.2.840.113549.1.7.1";
-		static string p7DataName = "PKCS 7 Data";
-
-		private void DefaultProperties (EnvelopedPkcs7 ep, int contentLength, int version) 
-		{
-			AssertEquals ("Certificates", 0, ep.Certificates.Count);
-			AssertEquals ("ContentEncryptionAlgorithm.KeyLength", 0, ep.ContentEncryptionAlgorithm.KeyLength);
-			AssertEquals ("ContentEncryptionAlgorithm.Oid.FriendlyName", tdesName, ep.ContentEncryptionAlgorithm.Oid.FriendlyName);
-			AssertEquals ("ContentEncryptionAlgorithm.Oid.Value", tdesOid, ep.ContentEncryptionAlgorithm.Oid.Value);
-			AssertEquals ("ContentEncryptionAlgorithm.Parameters", 0, ep.ContentEncryptionAlgorithm.Parameters.Length);
-			AssertEquals ("ContentInfo.ContentType.FriendlyName", p7DataName, ep.ContentInfo.ContentType.FriendlyName);
-			AssertEquals ("ContentInfo.ContentType.Value", p7DataOid, ep.ContentInfo.ContentType.Value);
-			AssertEquals ("ContentInfo.Content", contentLength, ep.ContentInfo.Content.Length);
-			AssertEquals ("RecipientInfos", 0, ep.RecipientInfos.Count);
-			AssertEquals ("UnprotectedAttributes", 0, ep.UnprotectedAttributes.Count);
-			AssertEquals ("Version", version, ep.Version);
-		}
-
-		private X509CertificateEx GetCertificate (bool includePrivateKey) 
-		{
-			return new X509CertificateEx (@"c:\farscape.p12.pfx", "farscape");
-		}
-
-		[Test]
-		public void ConstructorEmpty () 
-		{
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 ();
-			DefaultProperties (ep, 0, 0);
-		}
-
-		[Test]
-		public void ConstructorContentInfo () 
-		{
-			ContentInfo ci = new ContentInfo (asnNull);
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 (ci);
-			DefaultProperties (ep, asnNull.Length, 0);
-		}
-
-		[Test]
-		[ExpectedException (typeof (ArgumentNullException))]
-		public void ConstructorContentInfoNull () 
-		{
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 (null);
-		}
-
-		[Test]
-		public void ConstructorContentInfoAlgorithmIdentifier () 
-		{
-			AlgorithmIdentifier ai = new AlgorithmIdentifier ();
-			ContentInfo ci = new ContentInfo (asnNull);
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 (ci, ai);
-			DefaultProperties (ep, 2, 0);
-		}
-
-		[Test]
-		[ExpectedException (typeof (ArgumentNullException))]
-		public void ConstructorContentInfoNullAlgorithmIdentifier () 
-		{
-			AlgorithmIdentifier ai = new AlgorithmIdentifier ();
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 (null, ai);
-		}
-
-		[Test]
-		[ExpectedException (typeof (ArgumentNullException))]
-		public void ConstructorContentInfoAlgorithmIdentifierNull () 
-		{
-			ContentInfo ci = new ContentInfo (asnNull);
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 (ci, null);
-		}
-
-		[Test]
-		public void ConstructorSubjectIdentifierTypeIssuerAndSerialNumberContentInfoAlgorithmIdentifier () 
-		{
-			AlgorithmIdentifier ai = new AlgorithmIdentifier ();
-			ContentInfo ci = new ContentInfo (asnNull);
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 (SubjectIdentifierType.IssuerAndSerialNumber, ci, ai);
-			DefaultProperties (ep, 2, 0);
-		}
-
-		[Test]
-		public void ConstructorSubjectIdentifierTypeSubjectKeyIdentifierContentInfoAlgorithmIdentifier () 
-		{
-			AlgorithmIdentifier ai = new AlgorithmIdentifier ();
-			ContentInfo ci = new ContentInfo (asnNull);
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 (SubjectIdentifierType.SubjectKeyIdentifier, ci, ai);
-			DefaultProperties (ep, 2, 2);
-		}
-
-		[Test]
-		public void ConstructorSubjectIdentifierTypeUnknownContentInfoAlgorithmIdentifier () 
-		{
-			AlgorithmIdentifier ai = new AlgorithmIdentifier ();
-			ContentInfo ci = new ContentInfo (asnNull);
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 (SubjectIdentifierType.Unknown, ci, ai);
-			DefaultProperties (ep, 2, 0);
-		}
-
-		[Test]
-		public void ConstructorSubjectIdentifierTypeIssuerAndSerialNumberContentInfo () 
-		{
-			ContentInfo ci = new ContentInfo (asnNull);
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 (SubjectIdentifierType.IssuerAndSerialNumber, ci);
-			DefaultProperties (ep, 2, 0);
-		}
-
-		[Test]
-		public void ConstructorSubjectIdentifierTypeSubjectKeyIdentifierContentInfo () 
-		{
-			ContentInfo ci = new ContentInfo (asnNull);
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 (SubjectIdentifierType.SubjectKeyIdentifier, ci);
-			DefaultProperties (ep, 2, 2);
-		}
-
-		[Test]
-		public void ConstructorSubjectIdentifierTypeUnknownContentInfo () 
-		{
-			ContentInfo ci = new ContentInfo (asnNull);
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 (SubjectIdentifierType.Unknown, ci);
-			DefaultProperties (ep, 2, 0);
-		}
-
-		[Test]
-		public void Decode () 
-		{
-			byte[] encoded = { 0x30, 0x82, 0x01, 0x1C, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x03, 0xA0, 0x82, 0x01, 0x0D, 0x30, 0x82, 0x01, 0x09, 0x02, 0x01, 0x00, 0x31, 0x81, 0xD6, 0x30, 0x81, 0xD3, 0x02, 0x01, 0x00, 0x30, 0x3C, 0x30, 0x28, 0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x1D, 0x4D, 0x6F, 0x74, 0x75, 0x73, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6E, 0x6F, 0x6C, 0x6F, 0x67, 0x69, 0x65, 0x73, 0x20, 0x69, 0x6E, 0x63, 0x2E, 0x28, 0x74, 0x65, 0x73, 0x74, 0x29, 0x02, 0x10, 0x91, 0xC4, 0x4B, 0x0D, 0xB7, 0xD8, 0x10, 0x84, 0x42, 0x26, 0x71, 0xB3, 0x97, 0xB5, 0x00, 0x97, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x81, 0x80, 0xCA, 0x4B, 0x97, 0x9C, 0xAB, 0x79, 0xC6, 0xDF, 0x6A, 0x27, 0xC7, 0x24, 0xC4, 0x5E, 0x3B, 0x31, 0xAD, 0xBC, 0x25, 0xE6, 0x38, 0x5E, 0x79, 0x26, 0x0E, 0x68, 0x46, 0x1D, 0x21, 0x81, 0x38, 0x92, 0xEC, 0xCB, 0x7C, 0x91, 0xD6, 0x09, 0x38, 0x91, 0xCE, 0x50, 0x5B, 0x70, 0x31, 0xB0, 0x9F, 0xFC, 0xE2, 0xEE, 0x45, 0xBC, 0x4B, 0xF8, 0x9A, 0xD9, 0xEE, 0xE7, 0x4A, 0x3D, 0xCD, 0x8D, 0xFF, 0x10, 0xAB, 0xC8, 0x19, 0x05, 0x54, 0x5E, 0x40, 0x7A, 0xBE, 0x2B, 0xD7, 0x22, 0x97, 0xF3, 0x23, 0xAF, 0x50, 0xF5, 0xEB, 0x43, 0x06, 0xC3, 0xFB, 0x17, 0xCA, 0xBD, 0xAD, 0x28, 0xD8, 0x10, 0x0F, 0x61, 0xCE, 0xF8, 0x25, 0x70, 0xF6, 0xC8, 0x1E, 0x7F, 0x82, 0xE5, 0x94, 0xEB, 0x11, 0xBF, 0xB8, 0x6F, 0xEE, 0x79, 0xCD, 0x63, 0xDD, 0x59, 0x8D, 0x25, 0x0E, 0x78, 0x55, 0xCE, 0x21, 0xBA, 0x13, 0x6B, 0x30, 0x2B, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x01, 0x30, 0x14, 0x06, 0x08, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x03, 0x07, 0x04, 0x08, 0x8C, 0x5D, 0xC9, 0x87, 0x88, 0x9C, 0x05, 0x72, 0x80, 0x08, 0x2C, 0xAF, 0x82, 0x91, 0xEC, 0xAD, 0xC5, 0xB5 };
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 ();
-			ep.Decode (encoded);
-			// properties
-			AssertEquals ("Certificates", 0, ep.Certificates.Count);
-			AssertEquals ("ContentEncryptionAlgorithm.KeyLength", 192, ep.ContentEncryptionAlgorithm.KeyLength);
-			AssertEquals ("ContentEncryptionAlgorithm.Oid.FriendlyName", tdesName, ep.ContentEncryptionAlgorithm.Oid.FriendlyName);
-			AssertEquals ("ContentEncryptionAlgorithm.Oid.Value", tdesOid, ep.ContentEncryptionAlgorithm.Oid.Value);
-			AssertEquals ("ContentEncryptionAlgorithm.Parameters", 16, ep.ContentEncryptionAlgorithm.Parameters.Length);
-			AssertEquals ("ContentInfo.ContentType.FriendlyName", p7DataName, ep.ContentInfo.ContentType.FriendlyName);
-			AssertEquals ("ContentInfo.ContentType.Value", p7DataOid, ep.ContentInfo.ContentType.Value);
-			AssertEquals ("ContentInfo.Content", 14, ep.ContentInfo.Content.Length);
-			AssertEquals ("RecipientInfos", 1, ep.RecipientInfos.Count);
-			RecipientInfo ri = ep.RecipientInfos [0];
-			Assert ("RecipientInfos is KeyTransRecipientInfo", (ri is KeyTransRecipientInfo));
-			AssertEquals ("UnprotectedAttributes", 0, ep.UnprotectedAttributes.Count);
-			AssertEquals ("Version", 0, ep.Version);
-		}
-
-		[Test]
-		[ExpectedException (typeof (ArgumentNullException))]
-		public void DecodeNull () 
-		{
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 ();
-			ep.Decode (null);
-		}
-
-		[Test]
-		[ExpectedException (typeof (InvalidOperationException))]
-		public void EncodeEmpty () 
-		{
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 ();
-			byte[] encoded = ep.Encode ();
-		}
-
-		[Test]
-		public void Decrypt () 
-		{
-			byte[] encoded = { 0x30, 0x82, 0x01, 0x1C, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x03, 0xA0, 0x82, 0x01, 0x0D, 0x30, 0x82, 0x01, 0x09, 0x02, 0x01, 0x00, 0x31, 0x81, 0xD6, 0x30, 0x81, 0xD3, 0x02, 0x01, 0x00, 0x30, 0x3C, 0x30, 0x28, 0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x1D, 0x4D, 0x6F, 0x74, 0x75, 0x73, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6E, 0x6F, 0x6C, 0x6F, 0x67, 0x69, 0x65, 0x73, 0x20, 0x69, 0x6E, 0x63, 0x2E, 0x28, 0x74, 0x65, 0x73, 0x74, 0x29, 0x02, 0x10, 0x91, 0xC4, 0x4B, 0x0D, 0xB7, 0xD8, 0x10, 0x84, 0x42, 0x26, 0x71, 0xB3, 0x97, 0xB5, 0x00, 0x97, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x81, 0x80, 0xCA, 0x4B, 0x97, 0x9C, 0xAB, 0x79, 0xC6, 0xDF, 0x6A, 0x27, 0xC7, 0x24, 0xC4, 0x5E, 0x3B, 0x31, 0xAD, 0xBC, 0x25, 0xE6, 0x38, 0x5E, 0x79, 0x26, 0x0E, 0x68, 0x46, 0x1D, 0x21, 0x81, 0x38, 0x92, 0xEC, 0xCB, 0x7C, 0x91, 0xD6, 0x09, 0x38, 0x91, 0xCE, 0x50, 0x5B, 0x70, 0x31, 0xB0, 0x9F, 0xFC, 0xE2, 0xEE, 0x45, 0xBC, 0x4B, 0xF8, 0x9A, 0xD9, 0xEE, 0xE7, 0x4A, 0x3D, 0xCD, 0x8D, 0xFF, 0x10, 0xAB, 0xC8, 0x19, 0x05, 0x54, 0x5E, 0x40, 0x7A, 0xBE, 0x2B, 0xD7, 0x22, 0x97, 0xF3, 0x23, 0xAF, 0x50, 0xF5, 0xEB, 0x43, 0x06, 0xC3, 0xFB, 0x17, 0xCA, 0xBD, 0xAD, 0x28, 0xD8, 0x10, 0x0F, 0x61, 0xCE, 0xF8, 0x25, 0x70, 0xF6, 0xC8, 0x1E, 0x7F, 0x82, 0xE5, 0x94, 0xEB, 0x11, 0xBF, 0xB8, 0x6F, 0xEE, 0x79, 0xCD, 0x63, 0xDD, 0x59, 0x8D, 0x25, 0x0E, 0x78, 0x55, 0xCE, 0x21, 0xBA, 0x13, 0x6B, 0x30, 0x2B, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x01, 0x30, 0x14, 0x06, 0x08, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x03, 0x07, 0x04, 0x08, 0x8C, 0x5D, 0xC9, 0x87, 0x88, 0x9C, 0x05, 0x72, 0x80, 0x08, 0x2C, 0xAF, 0x82, 0x91, 0xEC, 0xAD, 0xC5, 0xB5 };
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 ();
-			ep.Decode (encoded);
-
-			X509CertificateEx x509 = GetCertificate (true);
-			X509CertificateExCollection xc = new X509CertificateExCollection ();
-			xc.Add (x509);
-			ep.Decrypt (xc);
-			// properties
-			AssertEquals ("Certificates", 0, ep.Certificates.Count);
-			AssertEquals ("ContentEncryptionAlgorithm.KeyLength", 192, ep.ContentEncryptionAlgorithm.KeyLength);
-			AssertEquals ("ContentEncryptionAlgorithm.Oid.FriendlyName", tdesName, ep.ContentEncryptionAlgorithm.Oid.FriendlyName);
-			AssertEquals ("ContentEncryptionAlgorithm.Oid.Value", tdesOid, ep.ContentEncryptionAlgorithm.Oid.Value);
-			AssertEquals ("ContentEncryptionAlgorithm.Parameters", 16, ep.ContentEncryptionAlgorithm.Parameters.Length);
-			AssertEquals ("ContentInfo.ContentType.FriendlyName", p7DataName, ep.ContentInfo.ContentType.FriendlyName);
-			AssertEquals ("ContentInfo.ContentType.Value", p7DataOid, ep.ContentInfo.ContentType.Value);
-			AssertEquals ("ContentInfo.Content", "05-00", BitConverter.ToString (ep.ContentInfo.Content));
-			AssertEquals ("RecipientInfos", 1, ep.RecipientInfos.Count);
-			AssertEquals ("UnprotectedAttributes", 0, ep.UnprotectedAttributes.Count);
-			AssertEquals ("Version", 0, ep.Version);
-		}
-
-		[Test]
-		[ExpectedException (typeof (InvalidOperationException))]
-		public void DecryptEmpty () 
-		{
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 ();
-			ep.Decrypt ();
-		}
-
-		[Test]
-		[ExpectedException (typeof (ArgumentNullException))]
-		public void DecryptRecipientInfoNull () 
-		{
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 ();
-			RecipientInfo ri = null; // do not confuse compiler
-			ep.Decrypt (ri);
-		}
-
-		[Test]
-		[ExpectedException (typeof (ArgumentNullException))]
-		public void DecryptX509CertificateExCollectionNull () 
-		{
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 ();
-			X509CertificateExCollection xec = null; // do not confuse compiler
-			ep.Decrypt (xec);
-		}
-
-		[Test]
-		[ExpectedException (typeof (ArgumentNullException))]
-		public void DecryptRecipientInfoX509CertificateExCollectionNull () 
-		{
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 ();
-			X509CertificateExCollection xec = new X509CertificateExCollection ();
-			ep.Decrypt (null, xec);
-		}
-
-/*		[Test]
-		[ExpectedException (typeof (ArgumentNullException))]
-		public void DecryptX509CertificateExCollectionNull () 
-		{
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 ();
-			RecipientInfo ri = 
-			ep.Decrypt (ri, null);
-		}*/
-
-		private void RoundTrip (byte[] encoded) 
-		{
-			X509CertificateExCollection xc = new X509CertificateExCollection ();
-			xc.Add (GetCertificate (true));
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 ();
-			ep.Decode (encoded);
-			ep.Decrypt (xc);
-			AssertEquals ("ContentInfo.Content", "05-00", BitConverter.ToString (ep.ContentInfo.Content));
-		}
-
-		[Test]
-		public void EncryptPkcs7RecipientIssuerAndSerialNumber () 
-		{
-			ContentInfo ci = new ContentInfo (asnNull);
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 (SubjectIdentifierType.IssuerAndSerialNumber, ci);
-
-			X509CertificateEx x509 = GetCertificate (false);
-			Pkcs7Recipient p7r = new Pkcs7Recipient (SubjectIdentifierType.IssuerAndSerialNumber, x509);
-			ep.Encrypt (p7r);
-			byte[] encoded = ep.Encode ();
-			
-			FileStream fs = File.OpenWrite ("EncryptPkcs7RecipientIssuerAndSerialNumber.der");
-			fs.Write (encoded, 0, encoded.Length);
-			fs.Close ();
-
-			RoundTrip (encoded);
-		}
-
-		[Test]
-		public void EncryptPkcs7RecipientSubjectKeyIdentifier () 
-		{
-			ContentInfo ci = new ContentInfo (asnNull);
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 (SubjectIdentifierType.IssuerAndSerialNumber, ci);
-
-			X509CertificateEx x509 = GetCertificate (false);
-			Pkcs7Recipient p7r = new Pkcs7Recipient (SubjectIdentifierType.SubjectKeyIdentifier, x509);
-			ep.Encrypt (p7r);
-			byte[] encoded = ep.Encode ();
-			
-			FileStream fs = File.OpenWrite ("EncryptPkcs7RecipientSubjectKeyIdentifier.der");
-			fs.Write (encoded, 0, encoded.Length);
-			fs.Close ();
-
-			RoundTrip (encoded);
-		}
-
-		[Test]
-		public void EncryptPkcs7RecipientUnknown () 
-		{
-			ContentInfo ci = new ContentInfo (asnNull);
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 (SubjectIdentifierType.IssuerAndSerialNumber, ci);
-
-			X509CertificateEx x509 = GetCertificate (false);
-			Pkcs7Recipient p7r = new Pkcs7Recipient (SubjectIdentifierType.Unknown, x509);
-			ep.Encrypt (p7r);
-			byte[] encoded = ep.Encode ();
-			
-			FileStream fs = File.OpenWrite ("EncryptPkcs7RecipientUnknown.der");
-			fs.Write (encoded, 0, encoded.Length);
-			fs.Close ();
-
-			RoundTrip (encoded);
-		}
-
-		[Test]
-		[ExpectedException (typeof (CryptographicException))]
-		public void EncryptEmpty () 
-		{
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 ();
-			ep.Encrypt ();
-		}
-
-		[Test]
-		[ExpectedException (typeof (ArgumentNullException))]
-		public void EncryptPkcs7RecipientNull () 
-		{
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 ();
-			Pkcs7Recipient p7r = null; // do not confuse compiler
-			ep.Encrypt (p7r);
-		}
-
-		[Test]
-		[ExpectedException (typeof (ArgumentNullException))]
-		public void EncryptPkcs7RecipientCollectionNull () 
-		{
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 ();
-			Pkcs7RecipientCollection p7rc = null; // do not confuse compiler
-			ep.Encrypt (p7rc);
-		}
-	}
-}
-
-#endif

+ 22 - 2
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/KeyTransRecipientInfoTest.cs

@@ -2,9 +2,29 @@
 // KeyTransRecipientInfoTest.cs - NUnit tests for KeyTransRecipientInfo
 //
 // Author:
-//	Sebastien Pouliot ([email protected])
+//	Sebastien Pouliot  <[email protected]>
 //
 // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
 #if NET_2_0
@@ -28,7 +48,7 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
 
 		private KeyTransRecipientInfo GetKeyTransRecipientInfo (byte[] encoded) 
 		{
-			EnvelopedPkcs7 ep = new EnvelopedPkcs7 ();
+			EnvelopedCms ep = new EnvelopedCms ();
 			ep.Decode (encoded);
 			return (KeyTransRecipientInfo) ep.RecipientInfos [0];
 		}

+ 0 - 67
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/Pkcs7RecipientTest.cs

@@ -1,67 +0,0 @@
-//
-// Pkcs7RecipientTest.cs - NUnit tests for Pkcs7Recipient
-//
-// Author:
-//	Sebastien Pouliot ([email protected])
-//
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-//
-
-#if NET_2_0
-
-using NUnit.Framework;
-
-using System;
-using System.Collections;
-using System.Security.Cryptography;
-using System.Security.Cryptography.Pkcs;
-using System.Security.Cryptography.X509Certificates;
-using System.Security.Cryptography.Xml;
-
-namespace MonoTests.System.Security.Cryptography.Pkcs {
-
-	[TestFixture]
-	public class Pkcs7RecipientTest : Assertion {
-
-		private X509CertificateEx GetCertificate (bool includePrivateKey) 
-		{
-			return new X509CertificateEx (@"c:\farscape.p12.pfx", "farscape");
-		}
-
-		[Test]
-		public void IssuerAndSerialNumber () 
-		{
-			X509CertificateEx x509 = GetCertificate (true); 
-			Pkcs7Recipient p7r = new Pkcs7Recipient (SubjectIdentifierType.IssuerAndSerialNumber, x509);
-			AssertEquals ("RecipientIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, p7r.RecipientIdentifierType);
-			AssertEquals ("Certificate", x509.Thumbprint, p7r.Certificate.Thumbprint);
-		}
-
-		[Test]
-		public void SubjectKeyIdentifier () 
-		{
-			X509CertificateEx x509 = GetCertificate (true); 
-			Pkcs7Recipient p7r = new Pkcs7Recipient (SubjectIdentifierType.SubjectKeyIdentifier, x509);
-			AssertEquals ("RecipientIdentifierType", SubjectIdentifierType.SubjectKeyIdentifier, p7r.RecipientIdentifierType);
-			AssertEquals ("Certificate", x509.Thumbprint, p7r.Certificate.Thumbprint);
-		}
-
-		[Test]
-		public void Unknown () 
-		{
-			X509CertificateEx x509 = GetCertificate (true); 
-			Pkcs7Recipient p7r = new Pkcs7Recipient (SubjectIdentifierType.Unknown, x509);
-			AssertEquals ("RecipientIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, p7r.RecipientIdentifierType);
-			AssertEquals ("Certificate", x509.Thumbprint, p7r.Certificate.Thumbprint);
-		}
-
-		[Test]
-		[ExpectedException (typeof (ArgumentNullException))]
-		public void NullCertificate () 
-		{
-			Pkcs7Recipient p7r = new Pkcs7Recipient (SubjectIdentifierType.IssuerAndSerialNumber, null);
-		}
-	}
-}
-
-#endif

+ 0 - 275
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/Pkcs7SignerTest.cs

@@ -1,275 +0,0 @@
-//
-// Pkcs7SignerTest.cs - NUnit tests for Pkcs7Signer
-//
-// Author:
-//	Sebastien Pouliot ([email protected])
-//
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-//
-
-#if NET_2_0
-
-using NUnit.Framework;
-
-using System;
-using System.Collections;
-using System.Security.Cryptography;
-using System.Security.Cryptography.Pkcs;
-using System.Security.Cryptography.X509Certificates;
-
-namespace MonoTests.System.Security.Cryptography.Pkcs {
-
-	[TestFixture]
-	public class Pkcs7SignerTest : Assertion {
-
-		static byte[] asnNull = { 0x05, 0x00 };
-		static string sha1Oid = "1.3.14.3.2.26";
-		static string sha1Name = "sha1";
-		static string rsaOid = "1.2.840.113549.1.1.1";
-		static string rsaName = "RSA";
-
-		[Test]
-		public void ConstructorEmpty () 
-		{
-			Pkcs7Signer ps = new Pkcs7Signer ();
-			// default properties
-			AssertEquals ("AuthenticatedAttributes", 0, ps.AuthenticatedAttributes.Count);
-			AssertNull ("Certificate", ps.Certificate);
-			AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-			AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-			AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-			AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-			AssertEquals ("UnauthenticatedAttributes", 0, ps.UnauthenticatedAttributes.Count);
-		}
-
-		[Test]
-		public void ConstructorIssuerAndSerialNumber () 
-		{
-			Pkcs7Signer ps = new Pkcs7Signer (SubjectIdentifierType.IssuerAndSerialNumber);
-			// default properties
-			AssertEquals ("AuthenticatedAttributes", 0, ps.AuthenticatedAttributes.Count);
-			AssertNull ("Certificate", ps.Certificate);
-			AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-			AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-			AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-			AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-			AssertEquals ("UnauthenticatedAttributes", 0, ps.UnauthenticatedAttributes.Count);
-		}
-
-		[Test]
-		public void ConstructorSubjectKeyIdentifier () 
-		{
-			Pkcs7Signer ps = new Pkcs7Signer (SubjectIdentifierType.SubjectKeyIdentifier);
-			// default properties
-			AssertEquals ("AuthenticatedAttributes", 0, ps.AuthenticatedAttributes.Count);
-			AssertNull ("Certificate", ps.Certificate);
-			AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-			AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-			AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-			AssertEquals ("SignerIdentifierType", SubjectIdentifierType.SubjectKeyIdentifier, ps.SignerIdentifierType);
-			AssertEquals ("UnauthenticatedAttributes", 0, ps.UnauthenticatedAttributes.Count);
-		}
-
-		[Test]
-		public void ConstructorUnknown ()
-		{
-			Pkcs7Signer ps = new Pkcs7Signer (SubjectIdentifierType.Unknown);
-			// default properties
-			AssertEquals ("AuthenticatedAttributes", 0, ps.AuthenticatedAttributes.Count);
-			AssertNull ("Certificate", ps.Certificate);
-			AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-			AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-			AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-			// Unknown is converted to IssuerAndSerialNumber
-			AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-			AssertEquals ("UnauthenticatedAttributes", 0, ps.UnauthenticatedAttributes.Count);
-		}
-
-		// TODO: return valid x509 certifiate with private key
-		private X509CertificateEx GetValidCertificateWithPrivateKey () 
-		{
-			X509CertificateEx x509 = new X509CertificateEx ();
-			return x509;
-		}
-
-		[Test]
-		public void ConstructorX509CertificateEx () 
-		{
-			X509CertificateEx x509 = GetValidCertificateWithPrivateKey ();
-			Pkcs7Signer ps = new Pkcs7Signer (x509);
-			// default properties
-			AssertEquals ("AuthenticatedAttributes", 0, ps.AuthenticatedAttributes.Count);
-			AssertNotNull ("Certificate", ps.Certificate);
-			AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-			AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-			AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-			AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-			AssertEquals ("UnauthenticatedAttributes", 0, ps.UnauthenticatedAttributes.Count);
-		}
-
-		[Test]
-		public void ConstructorX509CertificateExEmpty () 
-		{
-			X509CertificateEx x509 = new X509CertificateEx (); // empty
-			Pkcs7Signer ps = new Pkcs7Signer (x509);
-			// default properties
-			AssertEquals ("AuthenticatedAttributes", 0, ps.AuthenticatedAttributes.Count);
-			AssertNotNull ("Certificate", ps.Certificate);
-			AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-			AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-			AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-			AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-			AssertEquals ("UnauthenticatedAttributes", 0, ps.UnauthenticatedAttributes.Count);
-		}
-
-		[Test]
-		//BUG [ExpectedException (typeof (ArgumentNullException))]
-		public void ConstructorX509CertificateExNull () 
-		{
-			Pkcs7Signer ps = new Pkcs7Signer (null);
-			// default properties
-			AssertEquals ("AuthenticatedAttributes", 0, ps.AuthenticatedAttributes.Count);
-			AssertNull ("Certificate", ps.Certificate);
-			AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-			AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-			AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-			AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-			AssertEquals ("UnauthenticatedAttributes", 0, ps.UnauthenticatedAttributes.Count);
-		}
-
-		[Test]
-		public void ConstructorIssuerAndSerialNumberX509CertificateEx () 
-		{
-			X509CertificateEx x509 = GetValidCertificateWithPrivateKey ();
-			Pkcs7Signer ps = new Pkcs7Signer (SubjectIdentifierType.IssuerAndSerialNumber, x509);
-			// default properties
-			AssertEquals ("AuthenticatedAttributes", 0, ps.AuthenticatedAttributes.Count);
-			AssertNotNull ("Certificate", ps.Certificate);
-			AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-			AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-			AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-			AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-			AssertEquals ("UnauthenticatedAttributes", 0, ps.UnauthenticatedAttributes.Count);
-		}
-
-		[Test]
-		public void ConstructorSubjectKeyIdentifierX509CertificateEx () 
-		{
-			X509CertificateEx x509 = GetValidCertificateWithPrivateKey ();
-			Pkcs7Signer ps = new Pkcs7Signer (SubjectIdentifierType.SubjectKeyIdentifier, x509);
-			// default properties
-			AssertEquals ("AuthenticatedAttributes", 0, ps.AuthenticatedAttributes.Count);
-			AssertNotNull ("Certificate", ps.Certificate);
-			AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-			AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-			AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-			AssertEquals ("SignerIdentifierType", SubjectIdentifierType.SubjectKeyIdentifier, ps.SignerIdentifierType);
-			AssertEquals ("UnauthenticatedAttributes", 0, ps.UnauthenticatedAttributes.Count);
-		}
-
-		[Test]
-		public void ConstructorUnknownX509CertificateEx () 
-		{
-			X509CertificateEx x509 = GetValidCertificateWithPrivateKey ();
-			Pkcs7Signer ps = new Pkcs7Signer (SubjectIdentifierType.Unknown, x509);
-			// default properties
-			AssertEquals ("AuthenticatedAttributes", 0, ps.AuthenticatedAttributes.Count);
-			AssertNotNull ("Certificate", ps.Certificate);
-			AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-			AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-			AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-			// Unknown is converted to IssuerAndSerialNumber
-			AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-			AssertEquals ("UnauthenticatedAttributes", 0, ps.UnauthenticatedAttributes.Count);
-		}
-
-		[Test]
-		//BUG [ExpectedException (typeof (ArgumentNullException))]
-		public void ConstructorIssuerAndSerialNumberX509CertificateExNull () 
-		{
-			Pkcs7Signer ps = new Pkcs7Signer (SubjectIdentifierType.IssuerAndSerialNumber, null);
-			// default properties
-			AssertEquals ("AuthenticatedAttributes", 0, ps.AuthenticatedAttributes.Count);
-			AssertNull ("Certificate", ps.Certificate);
-			AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-			AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-			AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-			AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-			AssertEquals ("UnauthenticatedAttributes", 0, ps.UnauthenticatedAttributes.Count);
-		}
-
-		[Test]
-		public void AuthenticatedAttributes () 
-		{
-			Pkcs7Signer ps = new Pkcs7Signer ();
-			AssertEquals ("AuthenticatedAttributes=0", 0, ps.AuthenticatedAttributes.Count);
-			ps.AuthenticatedAttributes.Add (new Pkcs9DocumentDescription ("mono"));
-			AssertEquals ("AuthenticatedAttributes=1", 1, ps.AuthenticatedAttributes.Count);
-		}
-
-		[Test]
-		public void Certificate () 
-		{
-			Pkcs7Signer ps = new Pkcs7Signer ();
-			AssertNull ("Certificate=default(null)", ps.Certificate);
-			ps.Certificate = GetValidCertificateWithPrivateKey ();
-			AssertNotNull ("Certificate!=null", ps.Certificate);
-			ps.Certificate = null;
-			AssertNull ("Certificate=null", ps.Certificate);
-		}
-
-		[Test]
-		public void Digest () 
-		{
-			Pkcs7Signer ps = new Pkcs7Signer ();
-			ps.DigestAlgorithm = new Oid ("1.2.840.113549.2.5");
-			AssertEquals ("DigestAlgorithm.FriendlyName", "md5", ps.DigestAlgorithm.FriendlyName);
-			AssertEquals ("DigestAlgorithm.Value", "1.2.840.113549.2.5", ps.DigestAlgorithm.Value);
-			ps.DigestAlgorithm = null;
-			AssertNull ("DigestAlgorithm=null", ps.DigestAlgorithm);
-		}
-
-		[Test]
-		public void IncludeOption () 
-		{
-			Pkcs7Signer ps = new Pkcs7Signer ();
-			ps.IncludeOption = X509IncludeOption.EndCertOnly;
-			AssertEquals ("EndCertOnly", X509IncludeOption.EndCertOnly, ps.IncludeOption);
-			ps.IncludeOption = X509IncludeOption.ExcludeRoot;
-			AssertEquals ("ExcludeRoot", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-			ps.IncludeOption = X509IncludeOption.None;
-			AssertEquals ("None", X509IncludeOption.None, ps.IncludeOption);
-			ps.IncludeOption = X509IncludeOption.WholeChain;
-			AssertEquals ("WholeChain", X509IncludeOption.WholeChain, ps.IncludeOption);
-		}
-
-		[Test]
-		public void SubjectIdentifierTypeProperty () 
-		{
-			Pkcs7Signer ps = new Pkcs7Signer ();
-			ps.SignerIdentifierType = SubjectIdentifierType.IssuerAndSerialNumber;
-			AssertEquals ("IssuerAndSerialNumber", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-			ps.SignerIdentifierType = SubjectIdentifierType.SubjectKeyIdentifier;
-			AssertEquals ("SubjectKeyIdentifier", SubjectIdentifierType.SubjectKeyIdentifier, ps.SignerIdentifierType);
-		}
-
-		[Test]
-		[ExpectedException (typeof (ArgumentException))]
-		public void SubjectIdentifierTypeUnknown () 
-		{
-			Pkcs7Signer ps = new Pkcs7Signer ();
-			ps.SignerIdentifierType = SubjectIdentifierType.Unknown;
-		}
-
-		[Test]
-		public void UnauthenticatedAttributes () 
-		{
-			Pkcs7Signer ps = new Pkcs7Signer ();
-			AssertEquals ("UnauthenticatedAttributes=0", 0, ps.UnauthenticatedAttributes.Count);
-			ps.UnauthenticatedAttributes.Add (new Pkcs9DocumentDescription ("mono"));
-			AssertEquals ("UnauthenticatedAttributes=1", 1, ps.UnauthenticatedAttributes.Count);
-		}
-	}
-}
-
-#endif

+ 98 - 22
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/Pkcs9SigningTimeTest.cs

@@ -2,9 +2,29 @@
 // Pkcs9SigningTimeTest.cs - NUnit tests for Pkcs9SigningTime
 //
 // Author:
-//	Sebastien Pouliot ([email protected])
+//	Sebastien Pouliot  <[email protected]>
 //
 // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
 #if NET_2_0
@@ -19,49 +39,105 @@ using System.Security.Cryptography.Pkcs;
 namespace MonoTests.System.Security.Cryptography.Pkcs {
 
 	[TestFixture]
-	public class Pkcs9SigningTimeTest : Assertion {
+	public class Pkcs9SigningTimeTest {
 
 		static string signingTimeOid = "1.2.840.113549.1.9.5";
 		static string signingTimeName = "Signing Time";
+		static DateTime mono10release = new DateTime (632241648000000000);
 
 		[Test]
-		public void ConstructorEmpty () 
+		public void Constructor_Empty () 
 		{
 			Pkcs9SigningTime st = new Pkcs9SigningTime ();
-			AssertEquals ("Oid.FriendlyName", signingTimeName, st.Oid.FriendlyName);
-			AssertEquals ("Oid.Value", signingTimeOid, st.Oid.Value);
-			AssertEquals ("Values", 1, st.Values.Count);
+			Assert.AreEqual (signingTimeName, st.Oid.FriendlyName, "Oid.FriendlyName");
+			Assert.AreEqual (signingTimeOid, st.Oid.Value, "Oid.Value");
+			Assert.AreEqual (15, st.RawData.Length, "RawData.Length");
 		}
 
 		[Test]
-		public void ConstructorDateTime () 
+		public void Constructor_DateTime_Now () 
 		{
 			Pkcs9SigningTime st = new Pkcs9SigningTime (DateTime.UtcNow);
-			AssertEquals ("Oid.FriendlyName", signingTimeName, st.Oid.FriendlyName);
-			AssertEquals ("Oid.Value", signingTimeOid, st.Oid.Value);
-			AssertEquals ("Values", 1, st.Values.Count);
+			Assert.AreEqual (signingTimeName, st.Oid.FriendlyName, "Oid.FriendlyName");
+			Assert.AreEqual (signingTimeOid, st.Oid.Value, "Oid.Value");
+			Assert.AreEqual (15, st.RawData.Length, "RawData.Length");
 		}
 
 		[Test]
-		public void ConstructorMin () 
+		[ExpectedException (typeof (ArgumentOutOfRangeException))]
+		public void Constructor_DateTime_MinValue () 
 		{
 			Pkcs9SigningTime st = new Pkcs9SigningTime (DateTime.MinValue);
-			AssertEquals ("Oid.FriendlyName", signingTimeName, st.Oid.FriendlyName);
-			AssertEquals ("Oid.Value", signingTimeOid, st.Oid.Value);
-			AssertEquals ("Values", 1, st.Values.Count);
-			DateTime signingTime = (DateTime) st.Values [0];
-			AssertEquals ("Values[0]", DateTime.MinValue.Ticks, signingTime.Ticks);
 		}
 
 		[Test]
-		public void ConstructorMax () 
+		[ExpectedException (typeof (CryptographicException))]
+		public void Constructor_DateTime_MaxValue ()
 		{
 			Pkcs9SigningTime st = new Pkcs9SigningTime (DateTime.MaxValue);
-			AssertEquals ("Oid.FriendlyName", signingTimeName, st.Oid.FriendlyName);
-			AssertEquals ("Oid.Value", signingTimeOid, st.Oid.Value);
-			AssertEquals ("Values", 1, st.Values.Count);
-			DateTime signingTime = (DateTime) st.Values [0];
-			AssertEquals ("Values[0]", DateTime.MaxValue.Ticks, signingTime.Ticks);
+		}
+
+		[Test]
+		public void Constructor_DateTime ()
+		{
+			Pkcs9SigningTime st = new Pkcs9SigningTime (mono10release);
+			Assert.AreEqual (signingTimeName, st.Oid.FriendlyName, "Oid.FriendlyName");
+			Assert.AreEqual (signingTimeOid, st.Oid.Value, "Oid.Value");
+			Assert.AreEqual (15, st.RawData.Length, "RawData.Length");
+			Assert.AreEqual ("17-0D-30-34-30-36-33-30-30-34-30-30-30-30-5A", BitConverter.ToString (st.RawData), "RawData");
+			Assert.AreEqual (mono10release, st.SigningTime, "st.SigningTime");
+		}
+
+		[Test]
+		public void Constructor_Bytes () 
+		{
+			byte[] date = new byte [15] { 0x17, 0x0D, 0x30, 0x34, 0x30, 0x36, 0x33, 0x30, 0x30, 0x34, 0x30, 0x30, 0x30, 0x30, 0x5A };
+			Pkcs9SigningTime st = new Pkcs9SigningTime (date);
+			Assert.AreEqual (signingTimeName, st.Oid.FriendlyName, "Oid.FriendlyName");
+			Assert.AreEqual (signingTimeOid, st.Oid.Value, "Oid.Value");
+			Assert.AreEqual (15, st.RawData.Length, "RawData.Length");
+			Assert.AreEqual ("17-0D-30-34-30-36-33-30-30-34-30-30-30-30-5A", BitConverter.ToString (st.RawData), "RawData");
+			Assert.AreEqual (mono10release, st.SigningTime, "st.SigningTime");
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentNullException))]
+		public void Constructor_Bytes_Null ()
+		{
+			Pkcs9SigningTime st = new Pkcs9SigningTime (null);
+		}
+
+		[Test]
+		public void CopyFrom () 
+		{
+			Pkcs9SigningTime st1 = new Pkcs9SigningTime (mono10release);
+			Pkcs9SigningTime st2 = new Pkcs9SigningTime (DateTime.UtcNow);
+			st1.CopyFrom (st2);
+			Assert.AreEqual (st2.Oid.FriendlyName, st1.Oid.FriendlyName, "Oid.FriendlyName");
+			Assert.AreEqual (st2.Oid.Value, st1.Oid.Value, "Oid.Value");
+			Assert.AreEqual (BitConverter.ToString (st2.RawData), BitConverter.ToString (st1.RawData), "RawData");
+			// BUG - SigningTime isn't updated
+			Assert.AreEqual (st2.SigningTime, st1.SigningTime, "SigningTime");
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentNullException))]
+		public void CopyFrom_Null ()
+		{
+			new Pkcs9SigningTime (mono10release).CopyFrom (null);
+		}
+
+		[Test]
+		public void CopyFrom_Bad ()
+		{
+			Pkcs9SigningTime st = new Pkcs9SigningTime (mono10release);
+			Pkcs9DocumentName dn = new Pkcs9DocumentName ("Mono");
+			st.CopyFrom (dn);
+			Assert.AreEqual (dn.Oid.FriendlyName, st.Oid.FriendlyName, "Oid.FriendlyName");
+			Assert.AreEqual (dn.Oid.Value, st.Oid.Value, "Oid.Value");
+			Assert.AreEqual (BitConverter.ToString (dn.RawData), BitConverter.ToString (st.RawData), "RawData");
+			// BUG ???
+			Assert.AreEqual (mono10release, st.SigningTime, "SigningTime");
 		}
 	}
 }

+ 0 - 58
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/RecipientInfoTest.cs

@@ -1,58 +0,0 @@
-//
-// RecipientInfoTest.cs - NUnit tests for RecipientInfo
-//
-// Author:
-//	Sebastien Pouliot ([email protected])
-//
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-//
-
-#if NET_2_0
-
-using NUnit.Framework;
-
-using System;
-using System.Collections;
-using System.Security.Cryptography;
-using System.Security.Cryptography.Pkcs;
-
-namespace MonoTests.System.Security.Cryptography.Pkcs {
-
-	// RecipientInfo is an abstract class so this is a concrete implementation
-	// to test the (non abstract) constructor and Type property 
-	public class UTestRecipientInfo : RecipientInfo {
-
-		public UTestRecipientInfo () : base () {}
-
-		// properties
-
-		public override byte[] EncryptedKey { 
-			get { return null; }
-		}
-
-		public override AlgorithmIdentifier KeyEncryptionAlgorithm { 
-			get { return null; }
-		}
-
-		public override SubjectIdentifier RecipientIdentifier {
-			get { return null; }
-		}
-
-		public override int Version {
-			get { return 0; }
-		}
-	}
-
-	[TestFixture]
-	public class RecipientInfoTest : Assertion {
-
-		[Test]
-		public void Type () 
-		{
-			UTestRecipientInfo ri = new UTestRecipientInfo ();
-			AssertEquals ("Type", RecipientInfoType.Unknown, ri.Type);
-		}
-	}
-}
-
-#endif

+ 0 - 373
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/SignedPkcs7Test.cs

@@ -1,373 +0,0 @@
-//
-// SignedPkcs7Test.cs - NUnit tests for SignedPkcs7
-//
-// Author:
-//	Sebastien Pouliot ([email protected])
-//
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-//
-
-#if NET_2_0
-
-using NUnit.Framework;
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Security.Cryptography;
-using System.Security.Cryptography.Pkcs;
-using System.Security.Cryptography.X509Certificates;
-
-namespace MonoTests.System.Security.Cryptography.Pkcs {
-
-	[TestFixture]
-	public class SignedPkcs7Test : Assertion {
-
-		static byte[] asnNull = { 0x05, 0x00 };
-		static string pkcs7Oid = "1.2.840.113549.1.7.1";
-		static string pkcs7Name = "PKCS 7 Data";
-		static string rsaOid = "1.2.840.113549.1.1.1";
-		static string rsaName = "RSA";
-
-		private void DefaultProperties (SignedPkcs7 sp, int version) 
-		{
-			// unaffected by constructors
-			AssertEquals ("Certificates", 0, sp.Certificates.Count);
-			AssertEquals ("SignerInfos", 0, sp.SignerInfos.Count);
-			AssertEquals ("Version", version, sp.Version);
-		}
-
-		private X509CertificateEx GetCertificate (bool includePrivateKey) 
-		{
-			return new X509CertificateEx (@"c:\farscape.p12.pfx", "farscape");
-		}
-
-		[Test]
-		public void ConstructorEmpty () 
-		{
-			SignedPkcs7 sp = new SignedPkcs7 ();
-			// default properties
-			AssertEquals ("ContentInfo.ContentType.FriendlyName", pkcs7Name, sp.ContentInfo.ContentType.FriendlyName);
-			AssertEquals ("ContentInfo.ContentType.Value", pkcs7Oid, sp.ContentInfo.ContentType.Value);
-			AssertEquals ("ContentInfo.Content", 0, sp.ContentInfo.Content.Length);
-			Assert ("Detached", !sp.Detached);
-			DefaultProperties (sp, 0);
-		}
-
-		[Test]
-		public void ConstructorContentInfo () 
-		{
-			Oid oid = new Oid (rsaOid);
-			ContentInfo ci = new ContentInfo (oid, asnNull);
-			SignedPkcs7 sp = new SignedPkcs7 (ci);
-			// default properties
-			AssertEquals ("ContentInfo.ContentType.FriendlyName", rsaName, sp.ContentInfo.ContentType.FriendlyName);
-			AssertEquals ("ContentInfo.ContentType.Value", rsaOid, sp.ContentInfo.ContentType.Value);
-			AssertEquals ("ContentInfo.Content", 2, sp.ContentInfo.Content.Length);
-			Assert ("Detached", !sp.Detached);
-			DefaultProperties (sp, 0);
-		}
-
-		[Test]
-		[ExpectedException (typeof (ArgumentNullException))]
-		public void ConstructorContentInfoNull () 
-		{
-			SignedPkcs7 sp = new SignedPkcs7 (null);
-		}
-
-		[Test]
-		public void ConstructorContentInfoDetachedTrue () 
-		{
-			Oid oid = new Oid (rsaOid);
-			ContentInfo ci = new ContentInfo (oid, asnNull);
-			SignedPkcs7 sp = new SignedPkcs7 (ci, true);
-			// default properties
-			AssertEquals ("ContentInfo.ContentType.FriendlyName", rsaName, sp.ContentInfo.ContentType.FriendlyName);
-			AssertEquals ("ContentInfo.ContentType.Value", rsaOid, sp.ContentInfo.ContentType.Value);
-			AssertEquals ("ContentInfo.Content", 2, sp.ContentInfo.Content.Length);
-			Assert ("Detached", sp.Detached);
-			DefaultProperties (sp, 0);
-		}
-
-		[Test]
-		public void ConstructorContentInfoDetachedFalse () 
-		{
-			Oid oid = new Oid (rsaOid);
-			ContentInfo ci = new ContentInfo (oid, asnNull);
-			SignedPkcs7 sp = new SignedPkcs7 (ci, false);
-			// default properties
-			AssertEquals ("ContentInfo.ContentType.FriendlyName", rsaName, sp.ContentInfo.ContentType.FriendlyName);
-			AssertEquals ("ContentInfo.ContentType.Value", rsaOid, sp.ContentInfo.ContentType.Value);
-			AssertEquals ("ContentInfo.Content", 2, sp.ContentInfo.Content.Length);
-			Assert ("Detached", !sp.Detached);
-		}
-
-		[Test]
-		[ExpectedException (typeof (ArgumentNullException))]
-		public void ConstructorContentInfoNullDetached () 
-		{
-			SignedPkcs7 sp = new SignedPkcs7 (null, true);
-		}
-
-		private void DefaultSubjectIdentifierTypePropertiesPkcs7 (SignedPkcs7 sp, int version) 
-		{
-			AssertEquals ("ContentInfo.ContentType.FriendlyName", pkcs7Name, sp.ContentInfo.ContentType.FriendlyName);
-			AssertEquals ("ContentInfo.ContentType.Value", pkcs7Oid, sp.ContentInfo.ContentType.Value);
-			AssertEquals ("ContentInfo.Content", 0, sp.ContentInfo.Content.Length);
-			Assert ("Detached", !sp.Detached);
-			DefaultProperties (sp, version);
-		}
-
-		[Test]
-		public void ConstructorSubjectIdentifierTypeIssuerAndSerialNumber ()
-		{
-			SignedPkcs7 sp = new SignedPkcs7 (SubjectIdentifierType.IssuerAndSerialNumber);
-			// default properties
-			DefaultSubjectIdentifierTypePropertiesPkcs7 (sp, 0);
-		}
-
-		[Test]
-		public void ConstructorSubjectIdentifierTypeSubjectKeyIdentifier () 
-		{
-			SignedPkcs7 sp = new SignedPkcs7 (SubjectIdentifierType.SubjectKeyIdentifier);
-			// default properties
-			DefaultSubjectIdentifierTypePropertiesPkcs7 (sp, 2);
-		}
-
-		[Test]
-		public void ConstructorSubjectIdentifierTypeUnknown () 
-		{
-			SignedPkcs7 sp = new SignedPkcs7 (SubjectIdentifierType.Unknown);
-			// default properties
-			DefaultSubjectIdentifierTypePropertiesPkcs7 (sp, 0);
-		}
-
-		private void DefaultSubjectIdentifierTypeProperties (SignedPkcs7 sp, int version) 
-		{
-			AssertEquals ("ContentInfo.ContentType.FriendlyName", rsaName, sp.ContentInfo.ContentType.FriendlyName);
-			AssertEquals ("ContentInfo.ContentType.Value", rsaOid, sp.ContentInfo.ContentType.Value);
-			AssertEquals ("ContentInfo.Content", 2, sp.ContentInfo.Content.Length);
-			DefaultProperties (sp, version);
-		}
-
-		[Test]
-		public void ConstructorSubjectIdentifierTypeIssuerAndSerialNumberContentInfo () 
-		{
-			Oid oid = new Oid (rsaOid);
-			ContentInfo ci = new ContentInfo (oid, asnNull);
-			SignedPkcs7 sp = new SignedPkcs7 (SubjectIdentifierType.IssuerAndSerialNumber, ci);
-			// default properties
-			Assert ("Detached", !sp.Detached);
-			DefaultSubjectIdentifierTypeProperties (sp, 0);
-		}
-
-		[Test]
-		public void ConstructorSubjectIdentifierTypeSubjectKeyIdentifierContentInfo ()
-		{
-			Oid oid = new Oid (rsaOid);
-			ContentInfo ci = new ContentInfo (oid, asnNull);
-			SignedPkcs7 sp = new SignedPkcs7 (SubjectIdentifierType.SubjectKeyIdentifier, ci);
-			// default properties
-			Assert ("Detached", !sp.Detached);
-			DefaultSubjectIdentifierTypeProperties (sp, 2);
-		}
-
-		[Test]
-		public void ConstructorSubjectIdentifierTypeUnknownContentInfo ()
-		{
-			Oid oid = new Oid (rsaOid);
-			ContentInfo ci = new ContentInfo (oid, asnNull);
-			SignedPkcs7 sp = new SignedPkcs7 (SubjectIdentifierType.Unknown, ci);
-			// default properties
-			Assert ("Detached", !sp.Detached);
-			DefaultSubjectIdentifierTypeProperties (sp, 0);
-		}
-
-		[Test]
-		[ExpectedException (typeof (ArgumentNullException))]
-		public void ConstructorSubjectIdentifierTypeContentInfoNull () 
-		{
-			SignedPkcs7 sp = new SignedPkcs7 (SubjectIdentifierType.Unknown, null);
-		}
-
-		[Test]
-		public void ConstructorSubjectIdentifierTypeIssuerAndSerialNumberContentInfoDetached () 
-		{
-			Oid oid = new Oid (rsaOid);
-			ContentInfo ci = new ContentInfo (oid, asnNull);
-			SignedPkcs7 sp = new SignedPkcs7 (SubjectIdentifierType.IssuerAndSerialNumber, ci, true);
-			// default properties
-			Assert ("Detached", sp.Detached);
-			DefaultSubjectIdentifierTypeProperties (sp, 0);
-		}
-
-		[Test]
-		public void ConstructorSubjectIdentifierTypeSubjectKeyIdentifierContentInfoDetached () 
-		{
-			Oid oid = new Oid (rsaOid);
-			ContentInfo ci = new ContentInfo (oid, asnNull);
-			SignedPkcs7 sp = new SignedPkcs7 (SubjectIdentifierType.SubjectKeyIdentifier, ci, true);
-			// default properties
-			Assert ("Detached", sp.Detached);
-			DefaultSubjectIdentifierTypeProperties (sp, 2);
-		}
-
-		[Test]
-		public void ConstructorSubjectIdentifierTypeUnknownContentInfoDetached () 
-		{
-			Oid oid = new Oid (rsaOid);
-			ContentInfo ci = new ContentInfo (oid, asnNull);
-			SignedPkcs7 sp = new SignedPkcs7 (SubjectIdentifierType.Unknown, ci, true);
-			// default properties
-			Assert ("Detached", sp.Detached);
-			DefaultSubjectIdentifierTypeProperties (sp, 0);
-		}
-
-		[Test]
-		[ExpectedException (typeof (ArgumentNullException))]
-		public void ConstructorSubjectIdentifierTypeContentInfoNullDetached () 
-		{
-			SignedPkcs7 sp = new SignedPkcs7 (SubjectIdentifierType.Unknown, null, true);
-		}
-
-		private void RoundTrip (byte[] encoded) 
-		{
-			SignedPkcs7 sp = new SignedPkcs7 ();
-			sp.Decode (encoded);
-			sp.CheckSignature (true);
-		}
-
-		[Test]
-		public void ComputeSignaturePkcs7SignerIssuerAndSerialNumber () 
-		{
-			ContentInfo ci = new ContentInfo (asnNull);
-			SignedPkcs7 sp = new SignedPkcs7 (ci);
-
-			Pkcs7Signer signer = new Pkcs7Signer (SubjectIdentifierType.IssuerAndSerialNumber, GetCertificate (true));
-			sp.ComputeSignature (signer);
-
-			byte[] encoded = sp.Encode ();
-			string s = BitConverter.ToString (encoded);
-
-			FileStream fs = File.OpenWrite ("ComputeSignaturePkcs7SignerIssuerAndSerialNumber.der");
-			fs.Write (encoded, 0, encoded.Length);
-			fs.Close ();
-
-			RoundTrip (encoded);
-		}
-
-		[Test]
-		public void ComputeSignaturePkcs7SignerSubjectKeyIdentifier () 
-		{
-			ContentInfo ci = new ContentInfo (asnNull);
-			SignedPkcs7 sp = new SignedPkcs7 (ci);
-
-			Pkcs7Signer signer = new Pkcs7Signer (SubjectIdentifierType.SubjectKeyIdentifier, GetCertificate (true));
-			sp.ComputeSignature (signer);
-
-			byte[] encoded = sp.Encode ();
-			string s = BitConverter.ToString (encoded);
-
-			FileStream fs = File.OpenWrite ("ComputeSignaturePkcs7SignerSubjectKeyIdentifier.der");
-			fs.Write (encoded, 0, encoded.Length);
-			fs.Close ();
-
-			RoundTrip (encoded);
-		}
-
-		[Test]
-		public void ComputeSignaturePkcs7SignerUnknown () 
-		{
-			ContentInfo ci = new ContentInfo (asnNull);
-			SignedPkcs7 sp = new SignedPkcs7 (ci);
-
-			Pkcs7Signer signer = new Pkcs7Signer (SubjectIdentifierType.Unknown, GetCertificate (true));
-			sp.ComputeSignature (signer);
-
-			byte[] encoded = sp.Encode ();
-			string s = BitConverter.ToString (encoded);
-
-			FileStream fs = File.OpenWrite ("ComputeSignaturePkcs7SignerUnknown.der");
-			fs.Write (encoded, 0, encoded.Length);
-			fs.Close ();
-
-			RoundTrip (encoded);
-		}
-
-		[Test]
-		[ExpectedException (typeof (CryptographicException))]
-		public void ComputeEmptySignaturePkcs7Signer () 
-		{
-			Pkcs7Signer signer = new Pkcs7Signer ();
-			SignedPkcs7 sp = new SignedPkcs7 ();
-			sp.ComputeSignature (signer);
-		}
-
-		[Test]
-		[ExpectedException (typeof (CryptographicException))]
-		public void ComputeEmptySignature ()
-		{
-			SignedPkcs7 sp = new SignedPkcs7 ();
-			sp.ComputeSignature ();
-		}
-
-		private void CheckSignatureProperties (SignedPkcs7 sp, int version) 
-		{
-			AssertEquals ("Certificates", 1, sp.Certificates.Count);
-			AssertEquals ("ContentInfo.Content", 2, sp.ContentInfo.Content.Length);
-			Assert ("Detached", !sp.Detached);
-			AssertEquals ("SignerInfos", 1, sp.SignerInfos.Count);
-			AssertEquals ("Version", version, sp.Version);
-		}
-
-		[Test]
-		public void CheckSignaturePkcs7SignerIssuerAndSerialNumber () 
-		{
-			byte[] signature = { 0x30, 0x82, 0x03, 0x4C, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x02, 0xA0, 0x82, 0x03, 0x3D, 0x30, 0x82, 0x03, 0x39, 0x02, 0x01, 0x01, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00, 0x30, 0x11, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x01, 0xA0, 0x04, 0x04, 0x02, 0x05, 0x00, 0xA0, 0x82, 0x02, 0x2E, 0x30, 0x82, 0x02, 0x2A, 0x30, 0x82, 0x01, 0x97, 0xA0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x91, 0xC4, 0x4B, 0x0D, 0xB7, 0xD8, 0x10, 0x84, 0x42, 0x26, 0x71, 0xB3, 0x97, 0xB5, 0x00, 0x97, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1D, 0x05, 0x00, 0x30, 0x28, 0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x1D, 0x4D, 0x6F, 0x74, 0x75, 0x73, 0x20, 0x54, 0x65,
-				0x63, 0x68, 0x6E, 0x6F, 0x6C, 0x6F, 0x67, 0x69, 0x65, 0x73, 0x20, 0x69, 0x6E, 0x63, 0x2E, 0x28, 0x74, 0x65, 0x73, 0x74, 0x29, 0x30, 0x1E, 0x17, 0x0D, 0x30, 0x33, 0x30, 0x38, 0x31, 0x33, 0x30, 0x30, 0x34, 0x33, 0x34, 0x37, 0x5A, 0x17, 0x0D, 0x33, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5A, 0x30, 0x13, 0x31, 0x11, 0x30, 0x0F, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x08, 0x46, 0x41, 0x52, 0x53, 0x43, 0x41, 0x50, 0x45, 0x30, 0x81, 0x9F, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8D, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xD2, 0xCB, 0x47, 0x21, 0xF5, 0x62, 0xDD, 0x35, 0xBF, 0x1D, 0xEC, 0x9A, 0x4C, 0x07, 0x2C, 0x01, 0xF0, 0x28, 0xC2, 0x82, 0x17, 0x8E, 0x58, 0x32, 
-				0xD5, 0x4C, 0xAC, 0x86, 0xB4, 0xC9, 0xEB, 0x21, 0x26, 0xF3, 0x22, 0x30, 0xC5, 0x7A, 0xA3, 0x5A, 0xDD, 0x53, 0xAB, 0x1C, 0x06, 0x3E, 0xB2, 0x13, 0xC4, 0x05, 0x1D, 0x95, 0x8B, 0x0A, 0x71, 0x71, 0x11, 0xA7, 0x47, 0x26, 0x61, 0xF1, 0x76, 0xBE, 0x35, 0x72, 0x32, 0xC5, 0xCB, 0x47, 0xA4, 0x22, 0x41, 0x1E, 0xAD, 0x29, 0x11, 0x0D, 0x39, 0x22, 0x0C, 0x79, 0x90, 0xC6, 0x52, 0xA1, 0x10, 0xF6, 0x55, 0x09, 0x4E, 0x51, 0x26, 0x47, 0x0E, 0x94, 0xE6, 0x81, 0xF5, 0x18, 0x6B, 0x99, 0xF0, 0x76, 0xF3, 0xB2, 0x4C, 0x91, 0xE9, 0xBA, 0x3B, 0x3F, 0x6E, 0x63, 0xDA, 0x12, 0xD1, 0x0B, 0x73, 0x0E, 0x12, 0xC7, 0x70, 0x77, 0x22, 0x03, 0x9D, 0x5D, 0x02, 0x03, 0x01, 0x00, 0x01, 0xA3, 0x72, 0x30, 0x70, 0x30, 0x13, 0x06, 0x03, 0x55, 0x1D, 0x25, 0x04, 0x0C, 0x30, 0x0A, 0x06, 0x08, 0x2B, 
-				0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x59, 0x06, 0x03, 0x55, 0x1D, 0x01, 0x04, 0x52, 0x30, 0x50, 0x80, 0x10, 0xAE, 0xD7, 0x80, 0x88, 0xA6, 0x3D, 0xBA, 0x50, 0xA1, 0x7E, 0x57, 0xE5, 0x40, 0xC9, 0x6F, 0xC5, 0xA1, 0x2A, 0x30, 0x28, 0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x1D, 0x4D, 0x6F, 0x74, 0x75, 0x73, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6E, 0x6F, 0x6C, 0x6F, 0x67, 0x69, 0x65, 0x73, 0x20, 0x69, 0x6E, 0x63, 0x2E, 0x28, 0x74, 0x65, 0x73, 0x74, 0x29, 0x82, 0x10, 0x9D, 0xAE, 0xA3, 0x39, 0x47, 0x0E, 0xD4, 0xA2, 0x49, 0x78, 0xEA, 0x6C, 0xBA, 0x0D, 0xDE, 0x9C, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1D, 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x32, 0x8A, 0x7E, 0xAD, 0xE7, 0x67, 0x9E, 0x5C, 0x4C, 0xD8, 0x33, 0x59, 0x68, 0xCF, 
-				0x94, 0xC0, 0x36, 0x47, 0x7A, 0xA7, 0x85, 0xC2, 0xDD, 0xD8, 0xDA, 0x11, 0x3C, 0x66, 0xC1, 0x83, 0xE3, 0xAB, 0x33, 0x06, 0x7C, 0xE3, 0x6A, 0x15, 0x72, 0xB8, 0x83, 0x3D, 0x0B, 0xAB, 0x3C, 0xEE, 0x75, 0x13, 0xBD, 0x5C, 0x96, 0x25, 0x56, 0x36, 0x05, 0xFA, 0xAE, 0xD4, 0xF4, 0xCF, 0x52, 0xEC, 0x11, 0xB5, 0xEA, 0x9F, 0x20, 0xA3, 0xC8, 0x34, 0x72, 0x59, 0x09, 0x51, 0xE7, 0x36, 0x87, 0x86, 0x86, 0x98, 0xB5, 0x30, 0x7B, 0xFB, 0x3D, 0xCC, 0x5E, 0xE8, 0xC9, 0x49, 0xE0, 0xC6, 0xEA, 0x02, 0x76, 0x01, 0xE0, 0xBB, 0x8A, 0x70, 0xEB, 0x07, 0x86, 0xE8, 0x04, 0xE7, 0x48, 0xE4, 0x6C, 0x90, 0xE6, 0x16, 0x42, 0xB4, 0xBB, 0xC0, 0xC4, 0x82, 0x5F, 0xF8, 0xFB, 0x7E, 0xB2, 0x9E, 0xC2, 0x78, 0x26, 0x86, 0x31, 0x81, 0xE1, 0x30, 0x81, 0xDE, 0x02, 0x01, 0x01, 0x30, 0x3C, 0x30, 0x28, 
-				0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x1D, 0x4D, 0x6F, 0x74, 0x75, 0x73, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6E, 0x6F, 0x6C, 0x6F, 0x67, 0x69, 0x65, 0x73, 0x20, 0x69, 0x6E, 0x63, 0x2E, 0x28, 0x74, 0x65, 0x73, 0x74, 0x29, 0x02, 0x10, 0x91, 0xC4, 0x4B, 0x0D, 0xB7, 0xD8, 0x10, 0x84, 0x42, 0x26, 0x71, 0xB3, 0x97, 0xB5, 0x00, 0x97, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x81, 0x80, 0x45, 0x88, 0x80, 0x58, 0xC7, 0x4F, 0xE4, 0xD8, 0x88, 0xB0, 0xC0, 0x08, 0x70, 0x84, 0xCC, 0x8E, 0xA7, 0xF1, 0xA4, 0x07, 0x41, 0x14, 0x3E, 0xF5, 0xEA, 0x6E, 0x05, 0x75, 0xB8, 0x58, 0xAA, 0x5C, 0x0E, 0xFD, 0x7A, 0x07, 0x09, 0xE1, 0x80, 0x94, 
-				0xBD, 0xAA, 0x45, 0xBB, 0x55, 0x9C, 0xC2, 0xD9, 0x72, 0x14, 0x4B, 0xA4, 0x64, 0xFB, 0x38, 0x9F, 0xD3, 0x22, 0xED, 0xB3, 0x0B, 0xF7, 0xAE, 0x4D, 0xE6, 0x65, 0x4D, 0x2A, 0x31, 0x18, 0xB5, 0xB4, 0x2D, 0x9E, 0x4E, 0xD7, 0xC0, 0x44, 0x5F, 0xAC, 0x43, 0xDC, 0x4F, 0x3D, 0x6D, 0x2C, 0x8C, 0xA1, 0xFE, 0x08, 0x38, 0xB7, 0xC4, 0xC4, 0x08, 0xDB, 0xF8, 0xF0, 0xC1, 0x55, 0x54, 0x49, 0x9D, 0xA4, 0x7F, 0x76, 0xDE, 0xF4, 0x29, 0x1C, 0x0B, 0x95, 0x10, 0x90, 0xB5, 0x0A, 0x9A, 0xEC, 0xCA, 0x89, 0x9A, 0x85, 0x92, 0x76, 0x78, 0x6F, 0x97, 0x67 };
-			SignedPkcs7 sp = new SignedPkcs7 ();
-			sp.Decode (signature);
-			sp.CheckSignature (true);
-			CheckSignatureProperties (sp, 1);
-		}
-
-		[Test]
-		public void CheckSignaturePkcs7SignerSubjectKeyIdentifier () 
-		{
-			byte[] signature = { 0x30, 0x82, 0x03, 0x24, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x02, 0xA0, 0x82, 0x03, 0x15, 0x30, 0x82, 0x03, 0x11, 0x02, 0x01, 0x03, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00, 0x30, 0x11, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x01, 0xA0, 0x04, 0x04, 0x02, 0x05, 0x00, 0xA0, 0x82, 0x02, 0x2E, 0x30, 0x82, 0x02, 0x2A, 0x30, 0x82, 0x01, 0x97, 0xA0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x91, 0xC4, 0x4B, 0x0D, 0xB7, 0xD8, 0x10, 0x84, 0x42, 0x26, 0x71, 0xB3, 0x97, 0xB5, 0x00, 0x97, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1D, 0x05, 0x00, 0x30, 0x28, 0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x1D, 0x4D, 0x6F, 0x74, 0x75, 0x73, 0x20, 0x54, 0x65, 
-				0x63, 0x68, 0x6E, 0x6F, 0x6C, 0x6F, 0x67, 0x69, 0x65, 0x73, 0x20, 0x69, 0x6E, 0x63, 0x2E, 0x28, 0x74, 0x65, 0x73, 0x74, 0x29, 0x30, 0x1E, 0x17, 0x0D, 0x30, 0x33, 0x30, 0x38, 0x31, 0x33, 0x30, 0x30, 0x34, 0x33, 0x34, 0x37, 0x5A, 0x17, 0x0D, 0x33, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5A, 0x30, 0x13, 0x31, 0x11, 0x30, 0x0F, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x08, 0x46, 0x41, 0x52, 0x53, 0x43, 0x41, 0x50, 0x45, 0x30, 0x81, 0x9F, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8D, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xD2, 0xCB, 0x47, 0x21, 0xF5, 0x62, 0xDD, 0x35, 0xBF, 0x1D, 0xEC, 0x9A, 0x4C, 0x07, 0x2C, 0x01, 0xF0, 0x28, 0xC2, 0x82, 0x17, 0x8E, 0x58, 0x32, 
-				0xD5, 0x4C, 0xAC, 0x86, 0xB4, 0xC9, 0xEB, 0x21, 0x26, 0xF3, 0x22, 0x30, 0xC5, 0x7A, 0xA3, 0x5A, 0xDD, 0x53, 0xAB, 0x1C, 0x06, 0x3E, 0xB2, 0x13, 0xC4, 0x05, 0x1D, 0x95, 0x8B, 0x0A, 0x71, 0x71, 0x11, 0xA7, 0x47, 0x26, 0x61, 0xF1, 0x76, 0xBE, 0x35, 0x72, 0x32, 0xC5, 0xCB, 0x47, 0xA4, 0x22, 0x41, 0x1E, 0xAD, 0x29, 0x11, 0x0D, 0x39, 0x22, 0x0C, 0x79, 0x90, 0xC6, 0x52, 0xA1, 0x10, 0xF6, 0x55, 0x09, 0x4E, 0x51, 0x26, 0x47, 0x0E, 0x94, 0xE6, 0x81, 0xF5, 0x18, 0x6B, 0x99, 0xF0, 0x76, 0xF3, 0xB2, 0x4C, 0x91, 0xE9, 0xBA, 0x3B, 0x3F, 0x6E, 0x63, 0xDA, 0x12, 0xD1, 0x0B, 0x73, 0x0E, 0x12, 0xC7, 0x70, 0x77, 0x22, 0x03, 0x9D, 0x5D, 0x02, 0x03, 0x01, 0x00, 0x01, 0xA3, 0x72, 0x30, 0x70, 0x30, 0x13, 0x06, 0x03, 0x55, 0x1D, 0x25, 0x04, 0x0C, 0x30, 0x0A, 0x06, 0x08, 0x2B, 
-				0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x59, 0x06, 0x03, 0x55, 0x1D, 0x01, 0x04, 0x52, 0x30, 0x50, 0x80, 0x10, 0xAE, 0xD7, 0x80, 0x88, 0xA6, 0x3D, 0xBA, 0x50, 0xA1, 0x7E, 0x57, 0xE5, 0x40, 0xC9, 0x6F, 0xC5, 0xA1, 0x2A, 0x30, 0x28, 0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x1D, 0x4D, 0x6F, 0x74, 0x75, 0x73, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6E, 0x6F, 0x6C, 0x6F, 0x67, 0x69, 0x65, 0x73, 0x20, 0x69, 0x6E, 0x63, 0x2E, 0x28, 0x74, 0x65, 0x73, 0x74, 0x29, 0x82, 0x10, 0x9D, 0xAE, 0xA3, 0x39, 0x47, 0x0E, 0xD4, 0xA2, 0x49, 0x78, 0xEA, 0x6C, 0xBA, 0x0D, 0xDE, 0x9C, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1D, 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x32, 0x8A, 0x7E, 0xAD, 0xE7, 0x67, 0x9E, 0x5C, 0x4C, 0xD8, 0x33, 0x59, 0x68, 0xCF, 
-				0x94, 0xC0, 0x36, 0x47, 0x7A, 0xA7, 0x85, 0xC2, 0xDD, 0xD8, 0xDA, 0x11, 0x3C, 0x66, 0xC1, 0x83, 0xE3, 0xAB, 0x33, 0x06, 0x7C, 0xE3, 0x6A, 0x15, 0x72, 0xB8, 0x83, 0x3D, 0x0B, 0xAB, 0x3C, 0xEE, 0x75, 0x13, 0xBD, 0x5C, 0x96, 0x25, 0x56, 0x36, 0x05, 0xFA, 0xAE, 0xD4, 0xF4, 0xCF, 0x52, 0xEC, 0x11, 0xB5, 0xEA, 0x9F, 0x20, 0xA3, 0xC8, 0x34, 0x72, 0x59, 0x09, 0x51, 0xE7, 0x36, 0x87, 0x86, 0x86, 0x98, 0xB5, 0x30, 0x7B, 0xFB, 0x3D, 0xCC, 0x5E, 0xE8, 0xC9, 0x49, 0xE0, 0xC6, 0xEA, 0x02, 0x76, 0x01, 0xE0, 0xBB, 0x8A, 0x70, 0xEB, 0x07, 0x86, 0xE8, 0x04, 0xE7, 0x48, 0xE4, 0x6C, 0x90, 0xE6, 0x16, 0x42, 0xB4, 0xBB, 0xC0, 0xC4, 0x82, 0x5F, 0xF8, 0xFB, 0x7E, 0xB2, 0x9E, 0xC2, 0x78, 0x26, 0x86, 0x31, 0x81, 0xB9, 0x30, 0x81, 0xB6, 0x02, 0x01, 0x03, 0x80, 0x14, 0x02, 0xE1, 
-				0xA7, 0x32, 0x54, 0xAE, 0xFD, 0xC0, 0xA4, 0x32, 0x36, 0xF6, 0xFE, 0x23, 0x6A, 0x03, 0x72, 0x28, 0xB1, 0xF7, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x81, 0x80, 0x45, 0x88, 0x80, 0x58, 0xC7, 0x4F, 0xE4, 0xD8, 0x88, 0xB0, 0xC0, 0x08, 0x70, 0x84, 0xCC, 0x8E, 0xA7, 0xF1, 0xA4, 0x07, 0x41, 0x14, 0x3E, 0xF5, 0xEA, 0x6E, 0x05, 0x75, 0xB8, 0x58, 0xAA, 0x5C, 0x0E, 0xFD, 0x7A, 0x07, 0x09, 0xE1, 0x80, 0x94, 0xBD, 0xAA, 0x45, 0xBB, 0x55, 0x9C, 0xC2, 0xD9, 0x72, 0x14, 0x4B, 0xA4, 0x64, 0xFB, 0x38, 0x9F, 0xD3, 0x22, 0xED, 0xB3, 0x0B, 0xF7, 0xAE, 0x4D, 0xE6, 0x65, 0x4D, 0x2A, 0x31, 0x18, 0xB5, 0xB4, 0x2D, 0x9E, 0x4E, 0xD7, 0xC0, 0x44, 0x5F, 0xAC, 
-				0x43, 0xDC, 0x4F, 0x3D, 0x6D, 0x2C, 0x8C, 0xA1, 0xFE, 0x08, 0x38, 0xB7, 0xC4, 0xC4, 0x08, 0xDB, 0xF8, 0xF0, 0xC1, 0x55, 0x54, 0x49, 0x9D, 0xA4, 0x7F, 0x76, 0xDE, 0xF4, 0x29, 0x1C, 0x0B, 0x95, 0x10, 0x90, 0xB5, 0x0A, 0x9A, 0xEC, 0xCA, 0x89, 0x9A, 0x85, 0x92, 0x76, 0x78, 0x6F, 0x97, 0x67 };
-			SignedPkcs7 sp = new SignedPkcs7 ();
-			sp.Decode (signature);
-			sp.CheckSignature (true);
-			CheckSignatureProperties (sp, 3);
-		}
-
-		[Test]
-		public void CheckSignaturePkcs7SignerUnknown () 
-		{
-			byte[] signature = { 0x30, 0x82, 0x03, 0x4C, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x02, 0xA0, 0x82, 0x03, 0x3D, 0x30, 0x82, 0x03, 0x39, 0x02, 0x01, 0x01, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00, 0x30, 0x11, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x01, 0xA0, 0x04, 0x04, 0x02, 0x05, 0x00, 0xA0, 0x82, 0x02, 0x2E, 0x30, 0x82, 0x02, 0x2A, 0x30, 0x82, 0x01, 0x97, 0xA0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x91, 0xC4, 0x4B, 0x0D, 0xB7, 0xD8, 0x10, 0x84, 0x42, 0x26, 0x71, 0xB3, 0x97, 0xB5, 0x00, 0x97, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1D, 0x05, 0x00, 0x30, 0x28, 0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x1D, 0x4D, 0x6F, 0x74, 0x75, 0x73, 0x20, 0x54, 0x65, 
-				0x63, 0x68, 0x6E, 0x6F, 0x6C, 0x6F, 0x67, 0x69, 0x65, 0x73, 0x20, 0x69, 0x6E, 0x63, 0x2E, 0x28, 0x74, 0x65, 0x73, 0x74, 0x29, 0x30, 0x1E, 0x17, 0x0D, 0x30, 0x33, 0x30, 0x38, 0x31, 0x33, 0x30, 0x30, 0x34, 0x33, 0x34, 0x37, 0x5A, 0x17, 0x0D, 0x33, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5A, 0x30, 0x13, 0x31, 0x11, 0x30, 0x0F, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x08, 0x46, 0x41, 0x52, 0x53, 0x43, 0x41, 0x50, 0x45, 0x30, 0x81, 0x9F, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8D, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xD2, 0xCB, 0x47, 0x21, 0xF5, 0x62, 0xDD, 0x35, 0xBF, 0x1D, 0xEC, 0x9A, 0x4C, 0x07, 0x2C, 0x01, 0xF0, 0x28, 0xC2, 0x82, 0x17, 0x8E, 0x58, 0x32, 
-				0xD5, 0x4C, 0xAC, 0x86, 0xB4, 0xC9, 0xEB, 0x21, 0x26, 0xF3, 0x22, 0x30, 0xC5, 0x7A, 0xA3, 0x5A, 0xDD, 0x53, 0xAB, 0x1C, 0x06, 0x3E, 0xB2, 0x13, 0xC4, 0x05, 0x1D, 0x95, 0x8B, 0x0A, 0x71, 0x71, 0x11, 0xA7, 0x47, 0x26, 0x61, 0xF1, 0x76, 0xBE, 0x35, 0x72, 0x32, 0xC5, 0xCB, 0x47, 0xA4, 0x22, 0x41, 0x1E, 0xAD, 0x29, 0x11, 0x0D, 0x39, 0x22, 0x0C, 0x79, 0x90, 0xC6, 0x52, 0xA1, 0x10, 0xF6, 0x55, 0x09, 0x4E, 0x51, 0x26, 0x47, 0x0E, 0x94, 0xE6, 0x81, 0xF5, 0x18, 0x6B, 0x99, 0xF0, 0x76, 0xF3, 0xB2, 0x4C, 0x91, 0xE9, 0xBA, 0x3B, 0x3F, 0x6E, 0x63, 0xDA, 0x12, 0xD1, 0x0B, 0x73, 0x0E, 0x12, 0xC7, 0x70, 0x77, 0x22, 0x03, 0x9D, 0x5D, 0x02, 0x03, 0x01, 0x00, 0x01, 0xA3, 0x72, 0x30, 0x70, 0x30, 0x13, 0x06, 0x03, 0x55, 0x1D, 0x25, 0x04, 0x0C, 0x30, 0x0A, 0x06, 0x08, 0x2B, 
-				0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x59, 0x06, 0x03, 0x55, 0x1D, 0x01, 0x04, 0x52, 0x30, 0x50, 0x80, 0x10, 0xAE, 0xD7, 0x80, 0x88, 0xA6, 0x3D, 0xBA, 0x50, 0xA1, 0x7E, 0x57, 0xE5, 0x40, 0xC9, 0x6F, 0xC5, 0xA1, 0x2A, 0x30, 0x28, 0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x1D, 0x4D, 0x6F, 0x74, 0x75, 0x73, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6E, 0x6F, 0x6C, 0x6F, 0x67, 0x69, 0x65, 0x73, 0x20, 0x69, 0x6E, 0x63, 0x2E, 0x28, 0x74, 0x65, 0x73, 0x74, 0x29, 0x82, 0x10, 0x9D, 0xAE, 0xA3, 0x39, 0x47, 0x0E, 0xD4, 0xA2, 0x49, 0x78, 0xEA, 0x6C, 0xBA, 0x0D, 0xDE, 0x9C, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1D, 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x32, 0x8A, 0x7E, 0xAD, 0xE7, 0x67, 0x9E, 0x5C, 0x4C, 0xD8, 0x33, 0x59, 0x68, 0xCF, 
-				0x94, 0xC0, 0x36, 0x47, 0x7A, 0xA7, 0x85, 0xC2, 0xDD, 0xD8, 0xDA, 0x11, 0x3C, 0x66, 0xC1, 0x83, 0xE3, 0xAB, 0x33, 0x06, 0x7C, 0xE3, 0x6A, 0x15, 0x72, 0xB8, 0x83, 0x3D, 0x0B, 0xAB, 0x3C, 0xEE, 0x75, 0x13, 0xBD, 0x5C, 0x96, 0x25, 0x56, 0x36, 0x05, 0xFA, 0xAE, 0xD4, 0xF4, 0xCF, 0x52, 0xEC, 0x11, 0xB5, 0xEA, 0x9F, 0x20, 0xA3, 0xC8, 0x34, 0x72, 0x59, 0x09, 0x51, 0xE7, 0x36, 0x87, 0x86, 0x86, 0x98, 0xB5, 0x30, 0x7B, 0xFB, 0x3D, 0xCC, 0x5E, 0xE8, 0xC9, 0x49, 0xE0, 0xC6, 0xEA, 0x02, 0x76, 0x01, 0xE0, 0xBB, 0x8A, 0x70, 0xEB, 0x07, 0x86, 0xE8, 0x04, 0xE7, 0x48, 0xE4, 0x6C, 0x90, 0xE6, 0x16, 0x42, 0xB4, 0xBB, 0xC0, 0xC4, 0x82, 0x5F, 0xF8, 0xFB, 0x7E, 0xB2, 0x9E, 0xC2, 0x78, 0x26, 0x86, 0x31, 0x81, 0xE1, 0x30, 0x81, 0xDE, 0x02, 0x01, 0x01, 0x30, 0x3C, 0x30, 0x28, 
-				0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x1D, 0x4D, 0x6F, 0x74, 0x75, 0x73, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6E, 0x6F, 0x6C, 0x6F, 0x67, 0x69, 0x65, 0x73, 0x20, 0x69, 0x6E, 0x63, 0x2E, 0x28, 0x74, 0x65, 0x73, 0x74, 0x29, 0x02, 0x10, 0x91, 0xC4, 0x4B, 0x0D, 0xB7, 0xD8, 0x10, 0x84, 0x42, 0x26, 0x71, 0xB3, 0x97, 0xB5, 0x00, 0x97, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x81, 0x80, 0x45, 0x88, 0x80, 0x58, 0xC7, 0x4F, 0xE4, 0xD8, 0x88, 0xB0, 0xC0, 0x08, 0x70, 0x84, 0xCC, 0x8E, 0xA7, 0xF1, 0xA4, 0x07, 0x41, 0x14, 0x3E, 0xF5, 0xEA, 0x6E, 0x05, 0x75, 0xB8, 0x58, 0xAA, 0x5C, 0x0E, 0xFD, 0x7A, 0x07, 0x09, 0xE1, 0x80, 0x94, 
-				0xBD, 0xAA, 0x45, 0xBB, 0x55, 0x9C, 0xC2, 0xD9, 0x72, 0x14, 0x4B, 0xA4, 0x64, 0xFB, 0x38, 0x9F, 0xD3, 0x22, 0xED, 0xB3, 0x0B, 0xF7, 0xAE, 0x4D, 0xE6, 0x65, 0x4D, 0x2A, 0x31, 0x18, 0xB5, 0xB4, 0x2D, 0x9E, 0x4E, 0xD7, 0xC0, 0x44, 0x5F, 0xAC, 0x43, 0xDC, 0x4F, 0x3D, 0x6D, 0x2C, 0x8C, 0xA1, 0xFE, 0x08, 0x38, 0xB7, 0xC4, 0xC4, 0x08, 0xDB, 0xF8, 0xF0, 0xC1, 0x55, 0x54, 0x49, 0x9D, 0xA4, 0x7F, 0x76, 0xDE, 0xF4, 0x29, 0x1C, 0x0B, 0x95, 0x10, 0x90, 0xB5, 0x0A, 0x9A, 0xEC, 0xCA, 0x89, 0x9A, 0x85, 0x92, 0x76, 0x78, 0x6F, 0x97, 0x67 };
-			SignedPkcs7 sp = new SignedPkcs7 ();
-			sp.Decode (signature);
-			sp.CheckSignature (true);
-			CheckSignatureProperties (sp, 1);
-		}
-	}
-}
-
-#endif