Beispiel #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());
        }
Beispiel #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));
        }
Beispiel #3
0
 public RecipientInfo(
     KEKRecipientInfo info)
 {
     this.info = new DERTaggedObject(true, 2, info);
 }