예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="X509CertificatePolicy"/> class from a string that represents a
 /// policy OID value and an array of policy qualifiers that are associated with the specified policy OID.
 /// </summary>
 /// <param name="policyOid">A string that represents certificate policy OID value.</param>
 /// <param name="qualifiers">A collection of policy qualifiers.</param>
 /// <exception cref="ArgumentNullException">
 /// <strong>policyOid</strong> and/or <strong>qualifiers</strong> parameter is null or empty string.
 /// </exception>
 public X509CertificatePolicy(String policyOid, X509PolicyQualifierCollection qualifiers)
 {
     if (String.IsNullOrEmpty(policyOid))
     {
         throw new ArgumentNullException("policyOid");
     }
     if (qualifiers == null)
     {
         throw new ArgumentNullException("qualifiers");
     }
     m_initialize(policyOid, qualifiers);
 }
예제 #2
0
        void m_decode(Byte[] raw)
        {
            PolicyQualifiers = new X509PolicyQualifierCollection();
            Asn1Reader asn = new Asn1Reader(raw);

            if (asn.Tag != 48)
            {
                throw new InvalidDataException("The data is invalid.");
            }
            asn.MoveNext();
            PolicyOid = Asn1Utils.DecodeObjectIdentifier(asn.GetTagRawData());
            if (asn.MoveNext())
            {
                PolicyQualifiers.Decode(asn.GetTagRawData());
            }
        }
예제 #3
0
 void m_initialize(String policyOid, X509PolicyQualifierCollection qualifiers = null)
 {
     rawData.AddRange(Asn1Utils.EncodeObjectIdentifier(new Oid(policyOid)));
     PolicyOid        = new Oid(policyOid);
     PolicyQualifiers = qualifiers ?? new X509PolicyQualifierCollection();
 }
 internal X509PolicyQualifierCollectionEnumerator(X509PolicyQualifierCollection entries)
 {
     _entries  = entries;
     m_current = -1;
 }