Ejemplo n.º 1
0
 public SignerInfo(
     DerInteger version,
     IssuerAndSerialNumber issuerAndSerialNumber,
     AlgorithmIdentifier digAlgorithm,
     Asn1Set authenticatedAttributes,
     AlgorithmIdentifier digEncryptionAlgorithm,
     Asn1OctetString encryptedDigest,
     Asn1Set unauthenticatedAttributes)
 {
     this.version = version;
     this.issuerAndSerialNumber     = issuerAndSerialNumber;
     this.digAlgorithm              = digAlgorithm;
     this.authenticatedAttributes   = authenticatedAttributes;
     this.digEncryptionAlgorithm    = digEncryptionAlgorithm;
     this.encryptedDigest           = encryptedDigest;
     this.unauthenticatedAttributes = unauthenticatedAttributes;
 }
Ejemplo n.º 2
0
        public SignerInfo(
            Asn1Sequence seq)
        {
            IEnumerator e = seq.GetEnumerator();

            e.MoveNext();
            version = (DerInteger)e.Current;

            e.MoveNext();
            issuerAndSerialNumber = IssuerAndSerialNumber.GetInstance(e.Current);

            e.MoveNext();
            digAlgorithm = AlgorithmIdentifier.GetInstance(e.Current);

            e.MoveNext();
            object obj = e.Current;

            if (obj is Asn1TaggedObject)
            {
                authenticatedAttributes = Asn1Set.GetInstance((Asn1TaggedObject)obj, false);

                e.MoveNext();
                digEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(e.Current);
            }
            else
            {
                authenticatedAttributes = null;
                digEncryptionAlgorithm  = AlgorithmIdentifier.GetInstance(obj);
            }

            e.MoveNext();
            encryptedDigest = DerOctetString.GetInstance(e.Current);

            if (e.MoveNext())
            {
                unauthenticatedAttributes = Asn1Set.GetInstance((Asn1TaggedObject)e.Current, false);
            }
            else
            {
                unauthenticatedAttributes = null;
            }
        }