OtherCertID ::= SEQUENCE { otherCertHash OtherHash, issuerSerial IssuerSerial OPTIONAL }
Inheritance: Asn1Encodable
 private CompleteCertificateRefs(Asn1Sequence seq)
 {
     //IL_000e: Unknown result type (might be due to invalid IL or missing references)
     if (seq == null)
     {
         throw new ArgumentNullException("seq");
     }
     global::System.Collections.IEnumerator enumerator = seq.GetEnumerator();
     try
     {
         while (enumerator.MoveNext())
         {
             Asn1Encodable asn1Encodable = (Asn1Encodable)enumerator.get_Current();
             OtherCertID.GetInstance(asn1Encodable.ToAsn1Object());
         }
     }
     finally
     {
         global::System.IDisposable disposable = enumerator as global::System.IDisposable;
         if (disposable != null)
         {
             disposable.Dispose();
         }
     }
     otherCertIDs = seq;
 }
		public override void PerformTest()
		{
			AlgorithmIdentifier algId = new AlgorithmIdentifier(new DerObjectIdentifier("1.2.2.3"));
			byte[] digest = new byte[20];
			OtherHash otherHash = new OtherHash(
				new OtherHashAlgAndValue(algId, digest));
			OtherCertID otherCertID = new OtherCertID(otherHash);

			OtherSigningCertificate otherCert = new OtherSigningCertificate(otherCertID);

			checkConstruction(otherCert, otherCertID);

			otherCert = OtherSigningCertificate.GetInstance(null);

			if (otherCert != null)
			{
				Fail("null GetInstance() failed.");
			}

			try
			{
				OtherCertID.GetInstance(new Object());

				Fail("GetInstance() failed to detect bad object.");
			}
			catch (ArgumentException)
			{
				// expected
			}
		}
		public override void PerformTest()
		{
			AlgorithmIdentifier algId = new AlgorithmIdentifier(new DerObjectIdentifier("1.2.2.3"));
			byte[] digest = new byte[20];
			OtherHash otherHash = new OtherHash(new OtherHashAlgAndValue(algId, digest));
			IssuerSerial issuerSerial = new IssuerSerial(new GeneralNames(new GeneralName(new X509Name("CN=test"))), new DerInteger(1));

			OtherCertID certID = new OtherCertID(otherHash);

			checkConstruction(certID, algId, digest, null);

			certID = new OtherCertID(otherHash, issuerSerial);

			checkConstruction(certID, algId, digest, issuerSerial);

			certID = OtherCertID.GetInstance(null);

			if (certID != null)
			{
				Fail("null GetInstance() failed.");
			}

			try
			{
				OtherCertID.GetInstance(new Object());

				Fail("GetInstance() failed to detect bad object.");
			}
			catch (ArgumentException)
			{
				// expected
			}
		}
		public OtherCertID[] GetOtherCertIDs()
		{
			OtherCertID[] result = new OtherCertID[otherCertIDs.Count];
			for (int i = 0; i < otherCertIDs.Count; ++i)
			{
				result[i] = OtherCertID.GetInstance(otherCertIDs[i].ToAsn1Object());
			}
			return result;
		}
 public OtherCertID[] GetCerts()
 {
     OtherCertID[] array = new OtherCertID[certs.Count];
     for (int i = 0; i < certs.Count; i++)
     {
         array[i] = OtherCertID.GetInstance(certs[i].ToAsn1Object());
     }
     return(array);
 }
 public OtherCertID[] GetCerts()
 {
     OtherCertID[] cs = new OtherCertID[certs.Count];
     for (int i = 0; i < certs.Count; ++i)
     {
         cs[i] = OtherCertID.GetInstance(certs[i].ToAsn1Object());
     }
     return(cs);
 }
Example #7
0
 public OtherCertID[] GetOtherCertIDs()
 {
     OtherCertID[] result = new OtherCertID[otherCertIDs.Count];
     for (int i = 0; i < otherCertIDs.Count; ++i)
     {
         result[i] = OtherCertID.GetInstance(otherCertIDs[i].ToAsn1Object());
     }
     return(result);
 }
Example #8
0
 public OtherCertID[] GetOtherCertIDs()
 {
     OtherCertID[] array = new OtherCertID[this.otherCertIDs.Count];
     for (int i = 0; i < this.otherCertIDs.Count; i++)
     {
         array[i] = OtherCertID.GetInstance(this.otherCertIDs[i].ToAsn1Object());
     }
     return(array);
 }
		private void checkValues(
			OtherSigningCertificate	otherCert,
			OtherCertID				otherCertID)
		{
			if (otherCert.GetCerts().Length != 1)
			{
				Fail("GetCerts() length wrong");
			}
			checkMandatoryField("GetCerts()[0]", otherCertID, otherCert.GetCerts()[0]);
		}
Example #10
0
		private void checkValues(
			OtherCertID			certID,
			AlgorithmIdentifier	algId,
			byte[]				digest,
			IssuerSerial		issuerSerial)
		{
			checkMandatoryField("hashAlgorithm", algId, certID.OtherCertHash.HashAlgorithm);
			checkMandatoryField("hashValue", digest, certID.OtherCertHash.GetHashValue());

			checkOptionalField("issuerSerial", issuerSerial, certID.IssuerSerial);
		}
Example #11
0
 private CompleteCertificateRefs(Asn1Sequence seq)
 {
     if (seq == null)
     {
         throw new ArgumentNullException("seq");
     }
     foreach (Asn1Encodable asn1Encodable in seq)
     {
         OtherCertID.GetInstance(asn1Encodable.ToAsn1Object());
     }
     this.otherCertIDs = seq;
 }
		public OtherSigningCertificate(
			OtherCertID[]				certs,
			params PolicyInformation[]	policies)
		{
			if (certs == null)
				throw new ArgumentNullException("certs");

			this.certs = new DerSequence(certs);

			if (policies != null)
			{
				this.policies = new DerSequence(policies);
			}
		}
		private void checkConstruction(
			OtherSigningCertificate	otherCert,
			OtherCertID				otherCertID)
		{
			checkValues(otherCert, otherCertID);

			otherCert = OtherSigningCertificate.GetInstance(otherCert);

			checkValues(otherCert, otherCertID);

			Asn1InputStream aIn = new Asn1InputStream(otherCert.ToAsn1Object().GetEncoded());

			Asn1Sequence seq = (Asn1Sequence) aIn.ReadObject();

			otherCert = OtherSigningCertificate.GetInstance(seq);

			checkValues(otherCert, otherCertID);
		}
Example #14
0
		private void checkConstruction(
			OtherCertID			certID,
			AlgorithmIdentifier	algId,
			byte[]				digest,
			IssuerSerial		issuerSerial)
		{
			checkValues(certID, algId, digest, issuerSerial);

			certID = OtherCertID.GetInstance(certID);

			checkValues(certID, algId, digest, issuerSerial);

			Asn1InputStream aIn = new Asn1InputStream(certID.ToAsn1Object().GetEncoded());

			Asn1Sequence seq = (Asn1Sequence) aIn.ReadObject();

			certID = OtherCertID.GetInstance(seq);

			checkValues(certID, algId, digest, issuerSerial);
		}
		public OtherCertID[] GetCerts()
		{
			OtherCertID[] cs = new OtherCertID[certs.Count];
			for (int i = 0; i < certs.Count; ++i)
			{
				cs[i] = OtherCertID.GetInstance(certs[i].ToAsn1Object());
			}
			return cs;
		}