Exemple #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;
 }
Exemple #2
0
        public SignerInfo(
            ASN1Sequence seq)
        {
            IEnumerator e = seq.getObjects();

            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;
            }
        }