/** * Load the specified private key entry from the provided key store. * * @param aKeyStore * The key store to load the key from. May not be <code>null</code>. * @param sKeyStorePath * Key store path. For nice error messages only. May be * <code>null</code>. * @param sKeyStoreKeyAlias * The alias to be resolved in the key store. Must be non- * <code>null</code> to succeed. * @param aKeyStoreKeyPassword * The key password for the key store. Must be non-<code>null</code> to * succeed. * @return The key loading result. Never <code>null</code>. */ @Nonnull public static LoadedKey <KeyStore.PrivateKeyEntry> loadPrivateKey (@Nonnull final KeyStore aKeyStore, @Nonnull final String sKeyStorePath, @Nullable final String sKeyStoreKeyAlias, @Nullable final char [] aKeyStoreKeyPassword) { return _loadKey (aKeyStore, sKeyStorePath, sKeyStoreKeyAlias, aKeyStoreKeyPassword, KeyStore.PrivateKeyEntry.class); }
/** * Load the specified secret key entry from the provided key store. * * @param aKeyStore * The key store to load the key from. May not be <code>null</code>. * @param sKeyStorePath * Key store path. For nice error messages only. May be * <code>null</code>. * @param sKeyStoreKeyAlias * The alias to be resolved in the key store. Must be non- * <code>null</code> to succeed. * @param aKeyStoreKeyPassword * The key password for the key store. Must be non-<code>null</code> to * succeed. * @return The key loading result. Never <code>null</code>. */ @Nonnull public static LoadedKey <KeyStore.SecretKeyEntry> loadSecretKey (@Nonnull final KeyStore aKeyStore, @Nonnull final String sKeyStorePath, @Nullable final String sKeyStoreKeyAlias, @Nullable final char [] aKeyStoreKeyPassword) { return _loadKey (aKeyStore, sKeyStorePath, sKeyStoreKeyAlias, aKeyStoreKeyPassword, KeyStore.SecretKeyEntry.class); }
/** * Load the specified private key entry from the provided key store. * * @param aKeyStore * The key store to load the key from. May not be <code>null</code>. * @param sKeyStorePath * Key store path. For nice error messages only. May be * <code>null</code>. * @param sKeyStoreKeyAlias * The alias to be resolved in the key store. Must be non- * <code>null</code> to succeed. * @param aKeyStoreKeyPassword * The key password for the key store. Must be non-<code>null</code> to * succeed. * @return The key loading result. Never <code>null</code>. */ @Nonnull public static LoadedKey <KeyStore.TrustedCertificateEntry> loadTrustedCertificateKey (@Nonnull final KeyStore aKeyStore, @Nonnull final String sKeyStorePath, @Nullable final String sKeyStoreKeyAlias, @Nullable final char [] aKeyStoreKeyPassword) { return _loadKey (aKeyStore, sKeyStorePath, sKeyStoreKeyAlias, aKeyStoreKeyPassword, KeyStore.TrustedCertificateEntry.class); } }