![]() |
VOOZH | about |
The getEntry() method of java.security.KeyStore class is used to get the keystore entry for this instance with the help of the specified alias and the protection parameter.
Syntax:
public final KeyStore.Entry getEntry(String alias, KeyStore.ProtectionParameter protParam) throws NoSuchAlgorithmException, UnrecoverableEntryException, KeyStoreException
Parameter: This method accepts following arguments as a parameter.
Return Value: This method returns the keystore entry for the requested alias if it exists.
Exception: This method throws following exception
Note: All the programs in this article won’t run on online IDE as no ‘privatekey’ Keystore exists. You can check this code on Java compiler on your system. To check this code, create a Keystore ‘privatekey’ on your system and set your own Keystore password to access that Keystore.
Below are the examples to illustrate the getEntry() method:
Example 1:
Example 2: For KeyStoreException