Skip to content

Instantly share code, notes, and snippets.

View mackaypeter's full-sized avatar

Peter Mackay mackaypeter

  • Red Hat
View GitHub Profile
public static void main(String[] args) throws GeneralSecurityException, IOException {
// we don't need this, but java gets sad if it is missing
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
keyManagerFactory.init(getKeyStore(getTrustStoreFile(), KEYSTORE_PASSWORD.toCharArray()), // you should be able to use org.picketbox.util.KeyStoreUtil.getKeyStore() in the TS
KEYSTORE_PASSWORD.toCharArray());
// trust store factory setup
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init(getKeyStore(getTrustStoreFile(), KEYSTORE_PASSWORD.toCharArray()));