GetInstance() public static method

public static GetInstance ( object obj ) : OtherKeyAttribute
obj object
return OtherKeyAttribute
        public RecipientKeyIdentifier(
            Asn1Sequence seq)
        {
            subjectKeyIdentifier = Asn1OctetString.GetInstance(
                seq[0]);

            switch (seq.Count)
            {
            case 1:
                break;

            case 2:
                if (seq[1] is DerGeneralizedTime)
                {
                    date = (DerGeneralizedTime)seq[1];
                }
                else
                {
                    other = OtherKeyAttribute.GetInstance(seq[2]);
                }
                break;

            case 3:
                date  = (DerGeneralizedTime)seq[1];
                other = OtherKeyAttribute.GetInstance(seq[2]);
                break;

            default:
                throw new ArgumentException("Invalid RecipientKeyIdentifier");
            }
        }
Esempio n. 2
0
        public KekIdentifier(Asn1Sequence seq)
        {
            //IL_0093: Unknown result type (might be due to invalid IL or missing references)
            keyIdentifier = (Asn1OctetString)seq[0];
            switch (seq.Count)
            {
            case 2:
                if (seq[1] is DerGeneralizedTime)
                {
                    date = (DerGeneralizedTime)seq[1];
                }
                else
                {
                    other = OtherKeyAttribute.GetInstance(seq[2]);
                }
                break;

            case 3:
                date  = (DerGeneralizedTime)seq[1];
                other = OtherKeyAttribute.GetInstance(seq[2]);
                break;

            default:
                throw new ArgumentException("Invalid KekIdentifier");

            case 1:
                break;
            }
        }
Esempio n. 3
0
        public KekIdentifier(Asn1Sequence seq)
        {
            this.keyIdentifier = (Asn1OctetString)seq[0];
            switch (seq.Count)
            {
            case 1:
                return;

            case 2:
                if (seq[1] is DerGeneralizedTime)
                {
                    this.date = (DerGeneralizedTime)seq[1];
                    return;
                }
                this.other = OtherKeyAttribute.GetInstance(seq[2]);
                return;

            case 3:
                this.date  = (DerGeneralizedTime)seq[1];
                this.other = OtherKeyAttribute.GetInstance(seq[2]);
                return;

            default:
                throw new ArgumentException("Invalid KekIdentifier");
            }
        }