Skip to content

Instantly share code, notes, and snippets.

@gregorej
gregorej / CertificatesTest.java
Last active August 29, 2015 14:17
Get public key from X509 certificate
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.security.PublicKey;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import org.junit.Test;
public class CertificatesTest {