public Key getPublicKey(String alias, String type)
throws java.security.KeyStoreException,
java.security.NoSuchAlgorithmException,
java.security.UnrecoverableKeyException
{
EncryptionKeyManager keymanager;
if(EncryptionManager.PGP.equalsIgnoreCase(type)){
keymanager = pgpKeyMgr;
} else if(EncryptionManager.SMIME.equalsIgnoreCase(type)){
keymanager = smimeKeyMgr;
} else{
return null;
}
try {
return keymanager.getPublicKey(alias);
} catch (KeyStoreException kse) {
return null;
}
}