@ SneakyThrows public KeyStore loadKeystore ( String certResourceLocation , String privateKeyResourceLocation , String alias , String keyPassword ) { KeyStore keystore = createEmptyKeystore ( ) ; X509Certificate cert = loadCert ( certResourceLocation ) ; RSAPrivateKey privateKey = loadPrivateKey ( privateKeyResourceLocation ) ; addKeyToKeystore ( keystore , cert , privateKey , alias , keyPassword ) ; return keystore ; }
Based on a public certificate private key alias and password this method will load the certificate and private key as an entry into a newly created keystore and it will set the provided alias and password to the keystore entry .