Skip to content

Instantly share code, notes, and snippets.

View Maurice-Betzel's full-sized avatar

Maurice Betzel Maurice-Betzel

View GitHub Profile
Maurice-Betzel / gist:40ae823c72951e8b5e55ff801dc43f9b
Created December 1, 2022 19:15
Programmatic keyfile creation and PEM file import
* Create a KeyStore from standard PEM file
* @param privateKeyPem the private key PEM file
* @param certificatePem the certificate(s) PEM file
* @param the password to set to protect the private key
public static KeyStore createKeyStore(File privateKeyPem, File certificatePem, final String password)
throws Exception, KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException {
final X509Certificate[] cert = createCertificates(certificatePem);
Maurice-Betzel /
Created October 12, 2021 17:19 — forked from jwgmeligmeyling/
Persisting recursive relationships with Hibernate
package org.hibernate.test;
public class DatabaseTestModule extends AbstractModule {