question: public static String matchCertificate ( KeyStore keyStore , X509Certificate cert ) throws CryptoException { try { for ( Enumeration aliases = keyStore . aliases ( ) ; aliases . hasMoreElements ( ) ; ) { String alias = ( String ) aliases . nextElement ( ) ; if ( keyStore . isCertificateEntry ( alias ) ) { X509Certificate compCert = X509CertUtil . convertCertificate ( keyStore . getCertificate ( alias ) ) ; if ( cert . equals ( compCert ) ) { return alias ; } } } return null ; } catch ( KeyStoreException ex ) { throw new CryptoException ( res . getString ( "NoMatchCertificate.exception.message" ) , ex ) ; } }
target:  Check whether or not a trusted certificate in the supplied KeyStore matches the supplied X.509 certificate.