示例#1
0
    private PopoPrivKey(Asn1TaggedObject obj)
    {
        tagNo = obj.TagNo;
        switch (tagNo)
        {
        case 0:
            this.obj = DerBitString.GetInstance(obj, isExplicit: false);
            break;

        case 1:
            this.obj = SubsequentMessage.ValueOf(DerInteger.GetInstance(obj, isExplicit: false).Value.IntValue);
            break;

        case 2:
            this.obj = DerBitString.GetInstance(obj, isExplicit: false);
            break;

        case 3:
            this.obj = PKMacValue.GetInstance(obj, isExplicit: false);
            break;

        case 4:
            this.obj = EnvelopedData.GetInstance(obj, explicitly: false);
            break;

        default:
            throw new ArgumentException("unknown tag in PopoPrivKey", "obj");
        }
    }
    private PopoSigningKeyInput(Asn1Sequence seq)
    {
        Asn1Encodable asn1Encodable = seq[0];

        if (asn1Encodable is Asn1TaggedObject)
        {
            Asn1TaggedObject asn1TaggedObject = (Asn1TaggedObject)asn1Encodable;
            if (asn1TaggedObject.TagNo != 0)
            {
                throw new ArgumentException("Unknown authInfo tag: " + asn1TaggedObject.TagNo, "seq");
            }
            sender = GeneralName.GetInstance(asn1TaggedObject.GetObject());
        }
        else
        {
            publicKeyMac = PKMacValue.GetInstance(asn1Encodable);
        }
        publicKey = SubjectPublicKeyInfo.GetInstance(seq[1]);
    }