code: public final PrivateKey retrievePrivateKey(KeyStore keyStore, String keyName, char[] password) {
          try {
              logger.entry();
              PrivateKey privateKey = (PrivateKey) keyStore.getKey(keyName, password);
              logger.exit();
              return privateKey;
          } catch (KeyStoreException | NoSuchAlgorithmException | UnrecoverableKeyException e) {
              RuntimeException exception = new RuntimeException("An unexpected exception occurred while attempting to retrieve a private key.", e);
              logger.error(exception.toString());
              throw exception;
          }
      }
docs: This method retrieves a private key from a key store.
  
  @param keyStore The key store containing the private key.
  @param keyName The name (alias) of the private key.
  @param password The password used to encrypt the private key.
  @return The decrypted private key.