Esempio n. 1
0
 public SignerInfo(
     SignerIdentifier sid,
     AlgorithmIdentifier digAlgorithm,
     Attributes authenticatedAttributes,
     AlgorithmIdentifier digEncryptionAlgorithm,
     Asn1OctetString encryptedDigest,
     Attributes unauthenticatedAttributes)
 {
     this.version                   = new DerInteger(sid.IsTagged ? 3 : 1);
     this.sid                       = sid;
     this.digAlgorithm              = digAlgorithm;
     this.authenticatedAttributes   = Asn1Set.GetInstance(authenticatedAttributes);
     this.digEncryptionAlgorithm    = digEncryptionAlgorithm;
     this.encryptedDigest           = encryptedDigest;
     this.unauthenticatedAttributes = Asn1Set.GetInstance(unauthenticatedAttributes);
 }
Esempio n. 2
0
        public SignerInfo(
            Asn1Sequence seq)
        {
            IEnumerator e = seq.GetEnumerator();

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

            e.MoveNext();
            sid = SignerIdentifier.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;
            }
        }