Esempio n. 1
0
        public DERInteger getVersion()
        {
            if (info is ASN1TaggedObject)
            {
                ASN1TaggedObject o = (ASN1TaggedObject)info;

                switch ((int)o.getTagNo())
                {
                case 1:
                    return(KeyAgreeRecipientInfo.getInstance(o, true).getVersion());

                case 2:
                    return(KEKRecipientInfo.getInstance(o, true).getVersion());

                case 3:
                    return(PasswordRecipientInfo.getInstance(o, true).getVersion());

                case 4:
                    return(new DERInteger(0));    // no syntax version for OtherRecipientInfo

                default:
                    throw new InvalidOperationException("unknown tag");
                }
            }

            return(KeyTransRecipientInfo.getInstance(info).getVersion());
        }
Esempio n. 2
0
        public ASN1Encodable getInfo()
        {
            if (info is ASN1TaggedObject)
            {
                ASN1TaggedObject o = (ASN1TaggedObject)info;

                switch ((int)o.getTagNo())
                {
                case 1:
                    return(KeyAgreeRecipientInfo.getInstance(o, true));

                case 2:
                    return(KEKRecipientInfo.getInstance(o, true));

                case 3:
                    return(PasswordRecipientInfo.getInstance(o, true));

                case 4:
                    return(OtherRecipientInfo.getInstance(o, true));

                default:
                    throw new InvalidOperationException("unknown tag");
                }
            }

            return(KeyTransRecipientInfo.getInstance(info));
        }
Esempio n. 3
0
 public RecipientInfo(
     KeyAgreeRecipientInfo info)
 {
     this.info = new DERTaggedObject(true, 1, info);
 }