void decode(Asn1Reader asn) { asn.MoveNextAndExpectTags((Byte)Asn1Type.INTEGER); Version = (Int32) new Asn1Integer(asn).Value; asn.MoveNextAndExpectTags(48); RequestMessage = new TspMessageImprint(asn.GetTagRawData()); while (asn.MoveNextCurrentLevel()) { switch (asn.Tag) { case (Byte)Asn1Type.OBJECT_IDENTIFIER: PolicyID = new Asn1ObjectIdentifier(asn).Value; break; case (Byte)Asn1Type.INTEGER: UseNonce = true; nonce = new Asn1Integer(asn).Value.ToByteArray(); break; case (Byte)Asn1Type.BOOLEAN: RequestCertificates = new Asn1Boolean(asn).Value; break; case 0xa0: var extList = new X509ExtensionCollection(); extList.Decode(asn.GetTagRawData()); foreach (X509Extension extension in extList) { _extensions.Add(extension); } break; } } }
void decodeTstInfo(Asn1Reader asn) { asn.MoveNextAndExpectTags((Byte)Asn1Type.INTEGER); Version = (Int32) new Asn1Integer(asn).Value; asn.MoveNextAndExpectTags((Byte)Asn1Type.OBJECT_IDENTIFIER); PolicyID = new Asn1ObjectIdentifier(asn).Value; asn.MoveNextAndExpectTags(48); RequestMessage = new TspMessageImprint(asn.GetTagRawData()); asn.MoveNextCurrentLevelAndExpectTags((Byte)Asn1Type.INTEGER); SerialNumber = new Asn1Integer(asn).Value; asn.MoveNextAndExpectTags((Byte)Asn1Type.GeneralizedTime); GenerationTimestamp = new Asn1GeneralizedTime(asn).Value; decodeOptionalFields(asn); }
void initialize(Oid hashAlgorithm, Byte[] data) { RequestMessage = new TspMessageImprint(hashAlgorithm, data); }