Merge branch 'chore/all-my-stuffs' of https://github.com/sharevb/it-tools into chore/all-my-stuffs

This commit is contained in:
ShareVB committed 2025-02-23 10:48:34 +01:00
commit 50b9e726a2
1 file changed
+16 -10
@@ -1,4 +1,5 @@
import type {
AlgorithmHashType,
Certificate,
Fingerprint,
Key,
@@ -170,16 +171,21 @@ export function getCertificateLabelValues(cert: Certificate) {
})), null, 2),
multiline: true,
},
{
label: 'Fingerprint (sha256):',
value: onErrorReturnErrorMessage(() => cert.fingerprint('sha256')),
multiline: true,
},
{
label: 'Fingerprint (sha512):',
value: onErrorReturnErrorMessage(() => cert.fingerprint('sha512')),
multiline: true,
},
...['sha1', 'sha256', 'sha512'].flatMap(algorithm =>
[
{
label: `Fingerprint (${algorithm}):`,
value: onErrorReturnErrorMessage(() => cert.fingerprint(algorithm as AlgorithmHashType)),
multiline: true,
},
{
label: `Fingerprint HEX (${algorithm}):`,
value: onErrorReturnErrorMessage(() => cert.fingerprint(algorithm as AlgorithmHashType).toString('hex')),
multiline: true,
},
],
),
{
label: 'Certificate (pem):',
value: onErrorReturnErrorMessage(() => cert.toString('pem')),