Inheritance: Org.BouncyCastle.Asn1.Asn1Encodable
Example #1
0
		private ITestResult CompressionTest()
		{
			try
			{
				ContentInfo info = ContentInfo.GetInstance(
					Asn1Object.FromByteArray(compData));
				CompressedData data = CompressedData.GetInstance(info.Content);

				data = new CompressedData(data.CompressionAlgorithmIdentifier, data.EncapContentInfo);
				info = new ContentInfo(CmsObjectIdentifiers.CompressedData, data);

				if (!Arrays.AreEqual(info.GetEncoded(), compData))
				{
					return new SimpleTestResult(false, Name + ": CMS compression failed to re-encode");
				}

				return new SimpleTestResult(true, Name + ": Okay");
			}
			catch (Exception e)
			{
				return new SimpleTestResult(false, Name + ": CMS compression failed - " + e.ToString(), e);
			}
		}
 public static CompressedData GetInstance(Asn1TaggedObject ato, bool explicitly)
 {
     return(CompressedData.GetInstance(Asn1Sequence.GetInstance(ato, explicitly)));
 }