Java tutorial
//package com.java2s; //License from project: Open Source License import java.io.ByteArrayInputStream; import java.io.InputStream; import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; public class Main { public static X509Certificate unserializeCert(String cert) throws CertificateException { CertificateFactory cf = CertificateFactory.getInstance("X.509"); InputStream in = new ByteArrayInputStream(cert.getBytes()); return (X509Certificate) cf.generateCertificate(in); } }