import java.io.*; import java.security.cert.*; class Certificate { private static final String pem = "-----BEGIN CERTIFICATE-----\n" + "MIICRDCCAa0CBEGjPfYwDQYJKoZIhvcNAQEEBQAwaTELMAkGA1UEBhMCREUxDDAKBgNVBAgTA05S\n" + "VzESMBAGA1UEBxMJQmllbGVmZWxkMQ8wDQYDVQQKEwZIYWVnZXIxEDAOBgNVBAsTB1Vua25vd24x\n" + "FTATBgNVBAMTDEpvZXJnIEhhZWdlcjAeFw0wNDExMjMxMzQxMTBaFw0xNDExMjExMzQxMTBaMGkx\n" + "CzAJBgNVBAYTAkRFMQwwCgYDVQQIEwNOUlcxEjAQBgNVBAcTCUJpZWxlZmVsZDEPMA0GA1UEChMG\n" + "SGFlZ2VyMRAwDgYDVQQLEwdVbmtub3duMRUwEwYDVQQDEwxKb2VyZyBIYWVnZXIwgZ8wDQYJKoZI\n" + "hvcNAQEBBQADgY0AMIGJAoGBAM2DEUO4zKRLbg42VdzLIAXfp7ZVfkJ/MHSdi/NuSYKIsQNDZIc7\n" + "I/r9MzcivzuT+LUHtykaKQbN9Mtyh6SKTYawPlL6g0j0wlO8aX2IhAfjfmApaJfkUR9ztwSq7vYZ\n" + "WX9GR49NuLG00ERrR0+QpvOU3ORNJFYHXecZtkDrTAAXAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEA\n" + "xy/8c/jlGxCEkpsoG9UWSO+v8Lj2Sts/o4kU/RVqpO/9Pf379QEfWOW2TaFEbsn8Ok9nm2icp91f\n" + "2bmzrfVzuPV4esVMJtxqkuX44YJP2UPE5UMXSYa8S8siYOOKuW98jTP/SLwLWq7AqU6ote83nHfa\n" + "KdNmmPQ4E00UNimeHyI=\n" + "-----END CERTIFICATE-----"; static X509Certificate get() throws java.io.IOException, java.security.cert.CertificateException { InputStream inStream = new ByteArrayInputStream(pem.getBytes()); CertificateFactory cf = CertificateFactory.getInstance("X.509"); X509Certificate cert = (X509Certificate) cf.generateCertificate(inStream); inStream.close(); return cert; } }