CertificateDescription { public static CertificateDescription getInstance(Object obj) throws CertificateException { if (obj instanceof CertificateDescription) { return (CertificateDescription) obj; } else if (obj instanceof ASN1Set) { return new CertificateDescription((ASN1Sequence) obj); } else if (obj instanceof byte[]) { try { return new CertificateDescription((ASN1Sequence) ASN1Sequence.fromByteArray((byte[]) obj)); } catch (IOException e) { _logger.error("Cannot parse CertificateDescription", e); throw new IllegalArgumentException("Cannot parse CertificateDescription"); } } throw new IllegalArgumentException("Unknown object in factory: " + obj.getClass()); } private  CertificateDescription(ASN1Sequence seq); static CertificateDescription getInstance(Object obj); String getDescriptionType(); String getIssuerName(); String getIssuerURL(); String getSubjectName(); String getSubjectURL(); @Deprecated Object getTermsOfUsage(); String getTermsOfUsageString(); byte[] getTermsOfUsageBytes(); String getRedirectURL(); ArrayList<byte[]> getCommCertificates(); byte[] getEncoded(); String getTermsOfUsageMimeType(); boolean isTermsOfUsagePdf(); boolean isTermsOfUsageHtml(); boolean isTermsOfUsageText();  }
@Test public void testGetInstance() throws Exception { Object obj = StringUtils.toByteArray("308202D5060A04007F00070301030101A10E0C0C442D547275737420476D6248A2181316687474703A2F2F7777772E642D74727573742E6E6574A3120C1053594E4348524F4E49545920476D6248A429132768747470733A2F2F7777772E73796E6368726F6E6974792E6E65742F64656D6F706F7274616C2FA58201F20C8201EE4E616D652C20416E7363687269667420756E6420452D4D61696C2D4164726573736520646573204469656E7374616E626965746572733A0D0A53594E4348524F4E49545920476D62480D0A57696E7A65726C616572205374722E20320D0A3037373435204A656E610D0A6E70614073796E6368726F6E6974792E64650D0A0D0A5A7765636B2064657220446174656EEFBFBD6265726D6974746C756E673A0D0A4964656E746966697A696572756E6720756E642052656769737472696572756E67207A756D2070657273EFBFBD6E6C696368656E204B756E64656E6B6F6E746F0D0A0D0A5A757374EFBFBD6E6469676520446174656E73636875747A626568EFBFBD7264653A0D0A5468EFBFBD72696E676572204C616E64657376657277616C74756E6773616D74205265666572617420486F6865697473616E67656C6567656E68656974656E2C20476566616872656E6162776568720D0A5765696D6172706C61747A20340D0A3939343233205765696D61720D0A54656C3A20283033203631292033372037332037322035380D0A4661783A20283033203631292033372037332037332034360D0A706F73747374656C6C6540746C7677612E7468756572696E67656E2E64650D0A416E737072656368706172746E65723A204672617520416E6B65204E65756D616E6E0D0AA7683166042012054BDCDD69F93AFDBC8666B908C386B009821730C96C3C066F8E6A20D0BE0D0420D97D56EB57F16D0510FD77DE1B964D186E69CED9E6E17FBEA7DBB0F5B3A814650420E9B2B7E1430EFDE9E99A25603AD32E2671EFB6B00D921439428DF982CE168D44"); CertificateDescription result = CertificateDescription.getInstance(obj); }