public synchronized X509Certificate getCertificateByHostname ( final String hostname ) throws KeyStoreException , CertificateParsingException , InvalidKeyException , CertificateExpiredException , CertificateNotYetValidException , SignatureException , CertificateException , NoSuchAlgorithmException , NoSuchProviderException , UnrecoverableKeyException { String alias = _subjectMap . get ( getSubjectForHostname ( hostname ) ) ; if ( alias != null ) { return ( X509Certificate ) _ks . getCertificate ( alias ) ; } return getMappedCertificateForHostname ( hostname ) ; }
Returns the aliased certificate . Certificates are aliased by their hostname .