Example #1
0
        public static IssuerAndSerialNumber GetInstance(object obj)
        {
            if (obj == null)
            {
                return(null);
            }
            IssuerAndSerialNumber existing = obj as IssuerAndSerialNumber;

            if (existing != null)
            {
                return(existing);
            }
            return(new IssuerAndSerialNumber(Asn1Sequence.GetInstance(obj)));
        }
Example #2
0
        /**
         * return an KeyAgreeRecipientIdentifier object from the given object.
         *
         * @param obj the object we want converted.
         * @exception ArgumentException if the object cannot be converted.
         */
        public static KeyAgreeRecipientIdentifier GetInstance(
            object obj)
        {
            if (obj == null || obj is KeyAgreeRecipientIdentifier)
            {
                return((KeyAgreeRecipientIdentifier)obj);
            }

            if (obj is Asn1Sequence)
            {
                return(new KeyAgreeRecipientIdentifier(IssuerAndSerialNumber.GetInstance(obj)));
            }

            if (obj is Asn1TaggedObject && ((Asn1TaggedObject)obj).TagNo == 0)
            {
                return(new KeyAgreeRecipientIdentifier(RecipientKeyIdentifier.GetInstance(
                                                           (Asn1TaggedObject)obj, false)));
            }

            throw new ArgumentException("Invalid KeyAgreeRecipientIdentifier: " + Platform.GetTypeName(obj), "obj");
        }
Example #3
0
 public KeyAgreeRecipientIdentifier(
     IssuerAndSerialNumber issuerSerial)
 {
     this.issuerSerial = issuerSerial;
 }
Example #4
0
 public OriginatorIdentifierOrKey(
     IssuerAndSerialNumber id)
 {
     this.id = id;
 }
Example #5
0
 public SignerIdentifier(
     IssuerAndSerialNumber id)
 {
     this.id = id;
 }
Example #6
0
 public RecipientIdentifier(
     IssuerAndSerialNumber id)
 {
     this.id = id;
 }