VOOZH about

URL: https://www.geeksforgeeks.org/java/keystore-getcreationdate-method-in-java-with-examples/

⇱ KeyStore getCreationDate() method in Java with Examples - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

KeyStore getCreationDate() method in Java with Examples

Last Updated : 10 Feb, 2023

The getCreationDate() method of java.security.KeyStore class is used to get the date of creation of the specified entry with the help of the specified alias name. 

Syntax:

public final Date getCreationDate(String alias)
 throws KeyStoreException

Parameter: This method accepts the name of the alias as a parameter whose creation date is to be fetched. 

Return Value: This method returns the date of creation for the requested alias if it exists. 

Exception: This method throws KeyStoreException if you don't initialize this keystore. 

Note: All the programs in this article won’t run on online IDE as no ‘privatekey’ Keystore exists. You can check this code on the 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 getCreationDate() method: 
Example 1: 

Output: 👁 Image

Example 2: For KeyStoreException 

Comment