jwks checking and making sure you key is valid
Let's say you're given a JWKS endpoint and you would like to check if the thumbprint and the certificate matches.
How to validate JWKS x5t and x5c
Get the thumbprint
-----BEGIN CERTIFICATE-----
MIIDATCCAemgAwIBAgIJONNUmCmK7I XsMA0GCSqGSIb3DQEBCwUAMB4xHDAa BgNVBAMTE2tlcHVuZ2FwcC5hdXRoMC 5jb20wHhcNMjAwMzExMjEyMjU5WhcN MzMxMTE4MjEyMjU5WjAeMRwwGgYDVQ QDExNrZXB1bmdhcHAuYXV0aDAuY29t MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ 8AMIIBCgKCAQEAq0elaWKPAE845DDF 3m6oMc6pKqEvqAU4fBPU5YFEMqV59S ZZJ8ovmBdkktfXCyy6/QNTnFI+ JSZX0LeLvh3PpHKF1T0xdXkP9Q8KdP 8NeQkmckYdc2TX1dfERxfHR0tK6R6L 1CK6xohEsxcIXA8NdfHSUCnT+ cbSFeDnb0/ pUkIhcXOGVkrijoYHFBFhhISlG6cRh e/NTRPbwyo7YYGr/ IC45xSz4hrCZt8Qx1x/ oIdDfPakOiLw5ThxVIh8GUaZYpz3DP jGfigOaOYFd8l+ i1aGyJHfT86mtI5qwP5BGMCKcUbn++ 6do+ EfGirM6tMJ9Pik5ra3DYr4q305Fgzy XQIDAQABo0IwQDAPBgNVHRMBAf8EBT ADAQH/ MB0GA1UdDgQWBBQaBvGaWIDv/ axzCxtYKOACgR63vzAOBgNVHQ8BAf8 EBAMCAoQwDQYJKoZIhvcNAQELBQADg gEBAI3RPqveXDDKUEoO6aqv5AYOK5Z FswdQdiUMsO+ S8AqFDEMeTykQ19n2G+6lV1bvxwhy+ NDTBvwwsZFQ2CuhPFu19eJfwE6pmDx RYxrAGy06NnMwCn2adw9pnkYWdGrHf R6ggrsPubxFOgD4hmC1Rl4wBEBzOOI yllGlNcsGCKYd63KTx2qmjPAIuiebV Qhckl4riGfSiHi/pz3ojhJ/ 6NQgEIxPJUpXAeYjGeJ5cPuxc/ OnGXXplRiaKMv55icOJbhzLIRA3ezZ ZpJ41ksp2/ jnU6b3YEjFCc6tQzYtC0FIgVF4MgaZ wyhnnT1HXcJ4EGL3AASP+uO/ y823WKS2fRI=
-----END CERTIFICATE-----
MIIDATCCAemgAwIBAgIJONNUmCmK7I
-----END CERTIFICATE-----
You can check details of this cer by
certutil -dump .\tet.cer (assuming you store it as tet.cer
Or you can use this online tool here: https://www.samltool.com/fingerprint.php
You can see the it has the value - e04cc2c2f7c472b2907616c10eeea3 3d285c0be2
This is a hex value and you need to convert it to base64 - which is used by x5t.
Go to this URL or use your own text editor
Ensure the bytes and paste your e04cc2c2f7c472b2907616c10eeea3 3d285c0be2 to the textbox (underline with red).
Make sure you have selected Base64URL in the ENCODE/DECODE (middle part of the UI).
That would provide you with the 'based64 of 4EzCwvfEcrKQdhbBDu6jPShcC-I=
That's it!
Comments