Exemplo 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());
        }
Exemplo 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));
        }
Exemplo n.º 3
0
 public RecipientInfo(
     PasswordRecipientInfo info)
 {
     this.info = new DERTaggedObject(true, 3, info);
 }