Code example for Certificate

Methods: getPublicKey

0
     */ 
    protected Key getPublicKeyFromCertificate(String alias) {
        try { 
            Certificate certificate = keyStore.getCertificate(alias);
            if (certificate != null) {
                return certificate.getPublicKey();
            } 
        } catch (KeyStoreException e) {
            throw new SecureVaultException("Error loading key for alias : " + alias, e, log);
        } 
        return null; 
    } 
 
    /** 
     * Returns the key based on default alias or password 
     * 
     * @return Key , if there is a one , otherwise null 
     */ 
    protected Key getDefaultPrivateKey() {
        if (keyPassword != null) {
            return getKey(keyStoreInformation.getAlias(), keyPassword);