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
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
Maurice-Betzel / DatabaseTestModule.java
Created October 12, 2021 17:19 — forked from jwgmeligmeyling/DatabaseTestModule.java
Persisting recursive relationships with Hibernate
package org.hibernate.test;
import com.google.inject.AbstractModule;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.inject.persist.PersistService;
import com.google.inject.persist.jpa.JpaPersistModule;
public class DatabaseTestModule extends AbstractModule {