public void VerifyWriteObjectIdentifier_ConstructedIgnored(AsnEncodingRules ruleSet)
        {
            AsnWriter writer = new AsnWriter(ruleSet);

            const string OidValue            = "1.1";
            Asn1Tag      constructedOid      = new Asn1Tag(UniversalTagNumber.ObjectIdentifier, isConstructed: true);
            Asn1Tag      constructedContext0 = new Asn1Tag(TagClass.ContextSpecific, 0, isConstructed: true);

            writer.WriteObjectIdentifier(OidValue, constructedOid);
            writer.WriteObjectIdentifier(OidValue, constructedContext0);
            writer.WriteObjectIdentifier(OidValue.AsSpan(), constructedOid);
            writer.WriteObjectIdentifier(OidValue.AsSpan(), constructedContext0);

            Verify(writer, "060129800129060129800129");
        }
Пример #2
0
        public void VerifyWriteObjectIdentifier_ConstructedIgnored(PublicEncodingRules ruleSet)
        {
            using (AsnWriter writer = new AsnWriter((AsnEncodingRules)ruleSet))
            {
                const string OidValue            = "1.1";
                Asn1Tag      constructedOid      = new Asn1Tag(UniversalTagNumber.ObjectIdentifier, isConstructed: true);
                Asn1Tag      constructedContext0 = new Asn1Tag(TagClass.ContextSpecific, 0, isConstructed: true);

                writer.WriteObjectIdentifier(constructedOid, OidValue);
                writer.WriteObjectIdentifier(constructedContext0, OidValue);
                writer.WriteObjectIdentifier(constructedOid, OidValue.AsSpan());
                writer.WriteObjectIdentifier(constructedContext0, OidValue.AsSpan());
                writer.WriteObjectIdentifier(constructedOid, new Oid(OidValue, OidValue));
                writer.WriteObjectIdentifier(constructedContext0, new Oid(OidValue, OidValue));

                Verify(writer, "060129800129060129800129060129800129");
            }
        }