@ Override public void engineSetKeyEntry ( String s , Key key , char [ ] chars , Certificate [ ] certificates ) throws KeyStoreException { if ( ! ( key instanceof PrivateKey ) ) { throw new KeyStoreException ( "PrivateKey expected" ) ; } if ( ! ( certificates instanceof X509Certificate [ ] ) ) { throw new KeyStoreException ( "Certificate chain of X509Certificate expected" ) ; } CredentialWrapper wrapper ; X509Credential credential = new X509Credential ( ( PrivateKey ) key , ( X509Certificate [ ] ) certificates ) ; if ( credential . isEncryptedKey ( ) ) { wrapper = createCertKeyCredential ( s , credential ) ; } else { wrapper = createProxyCredential ( s , credential ) ; } storeWrapper ( wrapper ) ; this . aliasObjectMap . put ( wrapper . getAlias ( ) , wrapper ) ; }
Add a new private key to the keystore .