diff --git a/authentik/crypto/api.py b/authentik/crypto/api.py index 81c8f2b6e..0d5f97830 100644 --- a/authentik/crypto/api.py +++ b/authentik/crypto/api.py @@ -97,7 +97,8 @@ class CertificateKeyPairSerializer(ModelSerializer): fields = [ "pk", "name", - "fingerprint", + "fingerprint_sha256", + "fingerprint_sha1", "certificate_data", "key_data", "cert_expiry", diff --git a/authentik/crypto/models.py b/authentik/crypto/models.py index 1cfd71c79..6351887ea 100644 --- a/authentik/crypto/models.py +++ b/authentik/crypto/models.py @@ -68,12 +68,19 @@ class CertificateKeyPair(CreatedUpdatedModel): return self._private_key @property - def fingerprint(self) -> str: + def fingerprint_sha256(self) -> str: """Get SHA256 Fingerprint of certificate_data""" return hexlify(self.certificate.fingerprint(hashes.SHA256()), ":").decode( "utf-8" ) + @property + def fingerprint_sha1(self) -> str: + """Get SHA1 Fingerprint of certificate_data""" + return hexlify(self.certificate.fingerprint(hashes.SHA1()), ":").decode( + "utf-8" + ) + @property def kid(self): """Get Key ID used for JWKS""" diff --git a/schema.yml b/schema.yml index ce774b45a..8fc5277d6 100644 --- a/schema.yml +++ b/schema.yml @@ -18637,7 +18637,10 @@ components: title: Kp uuid name: type: string - fingerprint: + fingerprint_sha256: + type: string + readOnly: true + fingerprint_sha1: type: string readOnly: true cert_expiry: @@ -18660,7 +18663,8 @@ components: - cert_expiry - cert_subject - certificate_download_url - - fingerprint + - fingerprint_sha1 + - fingerprint_sha256 - name - pk - private_key_available diff --git a/web/src/locales/en.po b/web/src/locales/en.po index 8804e8aff..ecd51bc6c 100644 --- a/web/src/locales/en.po +++ b/web/src/locales/en.po @@ -488,8 +488,12 @@ msgid "Certificate" msgstr "Certificate" #: src/pages/crypto/CertificateKeyPairListPage.ts -msgid "Certificate Fingerprint" -msgstr "Certificate Fingerprint" +msgid "Certificate Fingerprint (SHA1)" +msgstr "Certificate Fingerprint (SHA1)" + +#: src/pages/crypto/CertificateKeyPairListPage.ts +msgid "Certificate Fingerprint (SHA256)" +msgstr "Certificate Fingerprint (SHA256)" #: src/pages/crypto/CertificateKeyPairListPage.ts msgid "Certificate Subjet" diff --git a/web/src/locales/pseudo-LOCALE.po b/web/src/locales/pseudo-LOCALE.po index ca57e8403..2659bbc15 100644 --- a/web/src/locales/pseudo-LOCALE.po +++ b/web/src/locales/pseudo-LOCALE.po @@ -484,7 +484,11 @@ msgid "Certificate" msgstr "" #: -msgid "Certificate Fingerprint" +msgid "Certificate Fingerprint (SHA1)" +msgstr "" + +#: +msgid "Certificate Fingerprint (SHA256)" msgstr "" #: diff --git a/web/src/pages/crypto/CertificateKeyPairListPage.ts b/web/src/pages/crypto/CertificateKeyPairListPage.ts index 921259f6d..f9c2d0a82 100644 --- a/web/src/pages/crypto/CertificateKeyPairListPage.ts +++ b/web/src/pages/crypto/CertificateKeyPairListPage.ts @@ -103,10 +103,18 @@ export class CertificateKeyPairListPage extends TablePage {
- ${t`Certificate Fingerprint`} + ${t`Certificate Fingerprint (SHA1)`}
-
${item.fingerprint}
+
${item.fingerprintSha1}
+
+
+
+
+ ${t`Certificate Fingerprint (SHA256)`} +
+
+
${item.fingerprintSha256}