Пример #1
0
    private Holder(Asn1Sequence seq)
    {
        if (seq.Count > 3)
        {
            throw new ArgumentException("Bad sequence size: " + seq.Count);
        }
        for (int i = 0; i != seq.Count; i++)
        {
            Asn1TaggedObject instance = Asn1TaggedObject.GetInstance(seq[i]);
            switch (instance.TagNo)
            {
            case 0:
                baseCertificateID = IssuerSerial.GetInstance(instance, explicitly: false);
                break;

            case 1:
                entityName = GeneralNames.GetInstance(instance, explicitly: false);
                break;

            case 2:
                objectDigestInfo = ObjectDigestInfo.GetInstance(instance, isExplicit: false);
                break;

            default:
                throw new ArgumentException("unknown tag in Holder");
            }
        }
        version = 1;
    }
        /**
         * Returns the hash if an object digest info is used.
         *
         * @return The hash or <code>null</code> if no object digest info is set.
         */
        public byte[] GetObjectDigest()
        {
            ObjectDigestInfo odi = holder.ObjectDigestInfo;

            return(odi == null
                                ?       null
                                :       odi.ObjectDigest.GetBytes());
        }
        public byte[] GetObjectDigest()
        {
            ObjectDigestInfo objectDigestInfo = this.holder.ObjectDigestInfo;

            if (objectDigestInfo != null)
            {
                return(objectDigestInfo.ObjectDigest.GetBytes());
            }
            return(null);
        }
Пример #4
0
    private V2Form(Asn1Sequence seq)
    {
        if (seq.Count > 3)
        {
            throw new ArgumentException("Bad sequence size: " + seq.Count);
        }
        int num = 0;

        if (!(seq[0] is Asn1TaggedObject))
        {
            num++;
            issuerName = GeneralNames.GetInstance(seq[0]);
        }
        int num2 = num;
        Asn1TaggedObject instance;

        while (true)
        {
            if (num2 == seq.Count)
            {
                return;
            }
            instance = Asn1TaggedObject.GetInstance(seq[num2]);
            if (instance.TagNo == 0)
            {
                baseCertificateID = IssuerSerial.GetInstance(instance, explicitly: false);
            }
            else
            {
                if (instance.TagNo != 1)
                {
                    break;
                }
                objectDigestInfo = ObjectDigestInfo.GetInstance(instance, isExplicit: false);
            }
            num2++;
        }
        throw new ArgumentException("Bad tag number: " + instance.TagNo);
    }
Пример #5
0
 public V2Form(GeneralNames issuerName, IssuerSerial baseCertificateID, ObjectDigestInfo objectDigestInfo)
 {
     this.issuerName        = issuerName;
     this.baseCertificateID = baseCertificateID;
     this.objectDigestInfo  = objectDigestInfo;
 }
Пример #6
0
 public V2Form(GeneralNames issuerName, ObjectDigestInfo objectDigestInfo)
     : this(issuerName, null, objectDigestInfo)
 {
 }
Пример #7
0
 public Holder(ObjectDigestInfo objectDigestInfo)
 {
     this.objectDigestInfo = objectDigestInfo;
     version = 1;
 }