/** * Create an iso7816Certificate structure from an object. * * @param obj the Object to extract the certificate from. * @return the Iso7816CertificateStructure represented by the byte stream. */ public static CVCertificate getInstance(Object obj) { if (obj instanceof CVCertificate) { return (CVCertificate) obj; } else if (obj != null) { try { return new CVCertificate(DERApplicationSpecific.getInstance(obj)); } catch (IOException e) { throw new ASN1ParsingException("unable to parse data: " + e.getMessage(), e); } } return null; }