Esempio n. 1
0
        private void recodeCheck(
            string oid,
            byte[]  enc)
        {
            DerObjectIdentifier o    = new DerObjectIdentifier(oid);
            DerObjectIdentifier encO = (DerObjectIdentifier)Asn1Object.FromByteArray(enc);

            if (!o.Equals(encO))
            {
                Fail("oid ID didn't match", o, encO);
            }

            byte[] bytes = o.GetDerEncoded();

            if (!Arrays.AreEqual(bytes, enc))
            {
                Fail("failed comparison test", Hex.ToHexString(enc), Hex.ToHexString(bytes));
            }
        }
Esempio n. 2
0
		private void recodeCheck(
			string	oid,
			byte[]	enc)
		{
			DerObjectIdentifier o = new DerObjectIdentifier(oid);
			DerObjectIdentifier encO = (DerObjectIdentifier) Asn1Object.FromByteArray(enc);

			if (!o.Equals(encO))
			{
				Fail("oid ID didn't match", o, encO);
			}

			byte[] bytes = o.GetDerEncoded();

			if (!Arrays.AreEqual(bytes, enc))
			{
				Fail("failed comparison test", Hex.ToHexString(enc), Hex.ToHexString(bytes));
			}
		}
Esempio n. 3
0
            public override byte[] ToArray()
            {
                DerObjectIdentifier objid = new DerObjectIdentifier(Value);

                return(objid.GetDerEncoded());
            }