▲ | gnabgib 7 days ago | ||||||||||||||||||||||
You can spot Base64 encoded JSON. The PEM format (that begins with `-----BEGIN [CERTIFICATE|CERTIFICATE REQUEST|PRIVATE KEY|X509 CRL|PUBLIC KEY]-----`) is already Base64 within the body.. the header and footer are ASCII, and shouldn't be encoded[0] (there's no link to the claim so perhaps there's another format similar to PEM?) You can't spot private keys, unless they start with a repeating text sequence (or use the PEM format with header also encoded). | |||||||||||||||||||||||
▲ | ctz 7 days ago | parent | next [-] | ||||||||||||||||||||||
The other base64 prefix to look out for is `MI`. `MI` is common to every ASN.1 DER encoded object (all public and private keys in standard encodings, all certificates, all CRLs) because overwhelmingly every object is a `SEQUENCE` (0x30 tag byte) followed by a length introducer (top nibble 0x8). `MII` is very very common, because it introduces a `SEQUENCE` with a two byte length. | |||||||||||||||||||||||
| |||||||||||||||||||||||
▲ | mschuster91 7 days ago | parent | prev | next [-] | ||||||||||||||||||||||
> The PEM format (that begins with `-----BEGIN [CERTIFICATE|CERTIFICATE REQUEST|PRIVATE KEY|X509 CRL|PUBLIC KEY]-----`) is already Base64 within the body.. the header and footer are ASCII, and shouldn't be encoded[0] (there's no link to the claim so perhaps there's another format similar to PEM?) In practice, you will spot fully b64 encoded PEMs all the time once you have Kubernetes in play... create a Secret from a file and that's what you will find. | |||||||||||||||||||||||
| |||||||||||||||||||||||
▲ | thibaultamartin 7 days ago | parent | prev [-] | ||||||||||||||||||||||
Thanks for pointing it out! I've added an errata to the blog post |