Created
September 24, 2015 19:53
-
-
Save icarocamelo/23570ca9a6360b98ba70 to your computer and use it in GitHub Desktop.
add-to-keystore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public java.security.cert.Certificate getCert(Certificate certificate, | |
InputStream certificateStream) throws NoSuchAlgorithmException, | |
CertificateException, IOException, KeyStoreException { | |
String alias = "alias"; // TODO: replace for certificate.getAlias() | |
KeyStore keystore = KeyStore.getInstance("JKS"); | |
keystore.load(certificateStream, | |
certificate.getKeyPassword().toCharArray()); | |
java.security.cert.Certificate cert = keystore.getCertificate(alias); | |
return cert; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment