public final X509Certificate retrieveCertificate ( KeyStore keyStore , String certificateName ) { try { logger . entry ( ) ; X509Certificate certificate = ( X509Certificate ) keyStore . getCertificate ( certificateName ) ; logger . exit ( ) ; return certificate ; } catch ( KeyStoreException e ) { RuntimeException exception = new RuntimeException ( "An unexpected exception occurred while attempting to retrieve a certificate." , e ) ; logger . error ( exception . toString ( ) ) ; throw exception ; } }
This method retrieves a public certificate from a key store .