public static RecipientIdentifier GetInstance(
object o)
{
if (o == null || o is RecipientIdentifier)
return (RecipientIdentifier)o;
if (o is IssuerAndSerialNumber)
return new RecipientIdentifier((IssuerAndSerialNumber) o);
if (o is Asn1OctetString)
return new RecipientIdentifier((Asn1OctetString) o);
if (o is Asn1Object)
return new RecipientIdentifier((Asn1Object) o);
throw new ArgumentException(
"Illegal object in RecipientIdentifier: " + o.GetType().Name);
}