/** * Return an AuthenticatedData object from the given object. * <p> * Accepted inputs: * <ul> * <li> null → null * <li> {@link AuthenticatedData} object * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with AuthenticatedData structure inside * </ul> * * @param obj the object we want converted. * @throws IllegalArgumentException if the object cannot be converted. */ public static AuthenticatedData getInstance( Object obj) { if (obj == null || obj instanceof AuthenticatedData) { return (AuthenticatedData)obj; } if (obj instanceof ASN1Sequence) { return new AuthenticatedData((ASN1Sequence)obj); } throw new IllegalArgumentException("Invalid AuthenticatedData: " + obj.getClass().getName()); }
/** * Return an AuthenticatedData object from a tagged object. * * @param obj the tagged object holding the object we want. * @param explicit true if the object is meant to be explicitly * tagged false otherwise. * @throws IllegalArgumentException if the object held by the * tagged object cannot be converted. */ public static AuthenticatedData getInstance( ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Sequence.getInstance(obj, explicit)); }
version = new ASN1Integer(calculateVersion(originatorInfo));
version = new ASN1Integer(calculateVersion(originatorInfo));
/** * Return an AuthenticatedData object from a tagged object. * * @param obj the tagged object holding the object we want. * @param explicit true if the object is meant to be explicitly * tagged false otherwise. * @return a reference that can be assigned to AuthenticatedData (may be null) * @throws IllegalArgumentException if the object held by the * tagged object cannot be converted. */ public static AuthenticatedData getInstance( ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Sequence.getInstance(obj, explicit)); }
/** * Return an AuthenticatedData object from the given object. * <p> * Accepted inputs: * <ul> * <li> null → null * <li> {@link AuthenticatedData} object * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with AuthenticatedData structure inside * </ul> * * @param obj the object we want converted. * @return a reference that can be assigned to AuthenticatedData (may be null) * @throws IllegalArgumentException if the object cannot be converted. */ public static AuthenticatedData getInstance( Object obj) { if (obj instanceof AuthenticatedData) { return (AuthenticatedData)obj; } else if (obj != null) { return new AuthenticatedData(ASN1Sequence.getInstance(obj)); } return null; }