diff --git a/lib/xmlseclibs.php b/lib/xmlseclibs.php
index 27830a543663c7cbbc7810c483668975a8d86ddf..54062a20117edb1c9282e1b823bd37d9cd4605c9 100644
--- a/lib/xmlseclibs.php
+++ b/lib/xmlseclibs.php
@@ -353,10 +353,9 @@ class XMLSecurityKey {
         }
         if ($this->cryptParams['library'] == 'openssl') {
             if ($this->cryptParams['type'] == 'public') {
-                if ($isCert) {
-                    /* Load the fingerprint if this is an X509 certificate. */
-                    $this->X509Fingerprint = self::calculateX509Fingerprint($this->key);
-                }
+                /* Load the fingerprint if this is an X509 certificate. */
+                $this->X509Fingerprint = self::calculateX509Fingerprint($this->key);
+
                 $this->key = openssl_get_publickey($this->key);
             } else {
                 $this->key = openssl_get_privatekey($this->key, $this->passphrase);