|
Answer» I imported a P12 certificate file to system on Windows 7, on which a Tomcat WEBAPP is running. I try to retrieve certificate with following code:
Code: [Select]private KSPrivateKeyEntry getKSPrivateKeyEntry(final String alias, ProtectionParameter passwordProtection) { KeyStore keyStore = getKeyStore(); try { if (keyStore.isKeyEntry(alias)) { final PrivateKeyEntry entry = (PrivateKeyEntry) keyStore.getEntry(alias, passwordProtection); return new KSPrivateKeyEntry(alias, entry); } } catch (GeneralSecurityException e) { throw new DSSException("UNABLE to retrieve key for alias '" + alias + "'", e); } return null; } Certificate not PRESENT in output and I am not sure, how to USE alias for a certificate in a proper way.
|