public static KeyStore createDockerKeyStore ( String certPath ) throws IOException , GeneralSecurityException { PrivateKey privKey = loadPrivateKey ( certPath + "/key.pem" ) ; Certificate [ ] certs = loadCertificates ( certPath + "/cert.pem" ) ; KeyStore keyStore = KeyStore . getInstance ( KeyStore . getDefaultType ( ) ) ; keyStore . load ( null ) ; keyStore . setKeyEntry ( "docker" , privKey , "docker" . toCharArray ( ) , certs ) ; addCA ( keyStore , certPath + "/ca.pem" ) ; return keyStore ; }
Create a key stored holding certificates and secret keys from the given Docker key cert