public AttributeCertificateInfo GenerateAttributeCertificateInfo()
        {
            if ((serialNumber == null) || (signature == null) ||
                (issuer == null) || (startDate == null) || (endDate == null) ||
                (holder == null) || (attributes == null))
            {
                throw new InvalidOperationException("not all mandatory fields set in V2 AttributeCertificateInfo generator");
            }

            Asn1EncodableVector v = new Asn1EncodableVector(
                version, holder, issuer, signature, serialNumber);

            //
            // before and after dates => AttCertValidityPeriod
            //
            v.Add(new AttCertValidityPeriod(startDate, endDate));

            // Attributes
            v.Add(new DerSequence(attributes));

            if (issuerUniqueID != null)
            {
                v.Add(issuerUniqueID);
            }

            if (extensions != null)
            {
                v.Add(extensions);
            }

            return(AttributeCertificateInfo.GetInstance(new DerSequence(v)));
        }
示例#2
0
        private AttributeCertificate(
            Asn1Sequence seq)
        {
            if (seq.Count != 3)
            {
                throw new ArgumentException("Bad sequence size: " + seq.Count);
            }

            this.acinfo             = AttributeCertificateInfo.GetInstance(seq[0]);
            this.signatureAlgorithm = AlgorithmIdentifier.GetInstance(seq[1]);
            this.signatureValue     = DerBitString.GetInstance(seq[2]);
        }