CertificateManagerImpl implements CertificateManager { @Override public X509Certificate getCertificateBy(String alias) throws CertificateManagerException { LOG.debug("debug -- CertificateManagerImpl-getDefaultCertificate:{}", alias); PrivateKeyEntry pkEntry = getPrivateKeyEntry(alias); if (pkEntry != null) { return (X509Certificate) pkEntry.getCertificate(); } return null; } private  CertificateManagerImpl(); static CertificateManager getInstance(); static CertificateManager getInstance(final Map<String, String> keyStoreProperties,
        final Map<String, String> trustStoreProperties); @Override KeyStore getKeyStore(); @Override KeyStore getTrustStore(); @Override void importCertificate(String alias, DataHandler data, boolean refreshCache); @Override boolean deleteCertificate(String alias); @Override boolean updateCertificate(String oldAlias, String newAlias, final String storeType, final String storeLoc,
        final String passkey, KeyStore storeCert); @Override X509Certificate getCertificateFromByteCode(DataHandler data); @Override X509Certificate getCertificateBy(String alias); @Override PrivateKey getPrivateKeyBy(String alias); @Override RSAPublicKey getPublicKeyBy(String alias); @Override Map<String, String> getTrustStoreSystemProperties(); @Override Map<String, String> getKeyStoreSystemProperties(); @Override KeyStore refreshKeyStore(); @Override String getKeyStoreLocation(); @Override String getTrustStoreLocation(); @Override KeyStore refreshTrustStore(); @Override void refreshServices(); @Override DataHandler transformToHandler(byte[] encoded); @Override byte[] transformToByteCode(DataHandler handler); @Override List<X509Certificate> getDefaultCertificates(); static final String TRUST_STORE_TYPE_KEY; static final String TRUST_STORE_PASSWORD_KEY; static final String TRUST_STORE_KEY; static final String KEY_STORE_TYPE_KEY; static final String KEY_STORE_PASSWORD_KEY; static final String KEY_STORE_KEY; static final String JKS_TYPE; }
@Test public void testGetDefaultCertificate() throws Exception { X509Certificate certificate = certManager.getCertificateBy(KEY_DEFAULT_CERT); assertNotNull(certificate); assertEquals(certificate.getSigAlgName(), "SHA256withRSA"); assertEquals(certificate.getSigAlgOID(), "1.2.840.113549.1.1.11"); }