GetInstance() public static method

public static GetInstance ( object o ) : SignerIdentifier
o object
return SignerIdentifier
Exemplo n.º 1
0
        public SignerInfo(Asn1Sequence seq)
        {
            IEnumerator enumerator = seq.GetEnumerator();

            enumerator.MoveNext();
            this.version = (DerInteger)enumerator.Current;
            enumerator.MoveNext();
            this.sid = SignerIdentifier.GetInstance(enumerator.Current);
            enumerator.MoveNext();
            this.digAlgorithm = AlgorithmIdentifier.GetInstance(enumerator.Current);
            enumerator.MoveNext();
            object current = enumerator.Current;

            if (current is Asn1TaggedObject)
            {
                this.authenticatedAttributes = Asn1Set.GetInstance((Asn1TaggedObject)current, false);
                enumerator.MoveNext();
                this.digEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(enumerator.Current);
            }
            else
            {
                this.authenticatedAttributes = null;
                this.digEncryptionAlgorithm  = AlgorithmIdentifier.GetInstance(current);
            }
            enumerator.MoveNext();
            this.encryptedDigest = Asn1OctetString.GetInstance(enumerator.Current);
            if (enumerator.MoveNext())
            {
                this.unauthenticatedAttributes = Asn1Set.GetInstance((Asn1TaggedObject)enumerator.Current, false);
                return;
            }
            this.unauthenticatedAttributes = null;
        }
Exemplo n.º 2
0
        public SignerInfo(Asn1Sequence seq)
        {
            global::System.Collections.IEnumerator enumerator = seq.GetEnumerator();
            enumerator.MoveNext();
            version = (DerInteger)enumerator.get_Current();
            enumerator.MoveNext();
            sid = SignerIdentifier.GetInstance(enumerator.get_Current());
            enumerator.MoveNext();
            digAlgorithm = AlgorithmIdentifier.GetInstance(enumerator.get_Current());
            enumerator.MoveNext();
            object current = enumerator.get_Current();

            if (current is Asn1TaggedObject)
            {
                authenticatedAttributes = Asn1Set.GetInstance((Asn1TaggedObject)current, explicitly: false);
                enumerator.MoveNext();
                digEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(enumerator.get_Current());
            }
            else
            {
                authenticatedAttributes = null;
                digEncryptionAlgorithm  = AlgorithmIdentifier.GetInstance(current);
            }
            enumerator.MoveNext();
            encryptedDigest = Asn1OctetString.GetInstance(enumerator.get_Current());
            if (enumerator.MoveNext())
            {
                unauthenticatedAttributes = Asn1Set.GetInstance((Asn1TaggedObject)enumerator.get_Current(), explicitly: false);
            }
            else
            {
                unauthenticatedAttributes = null;
            }
        }
Exemplo n.º 3
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;
            }
        }