Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REFERENCE ONLY] The QR codes were too large when the cert + key were embedded #15

Open
maelvls opened this issue Mar 18, 2024 · 0 comments

Comments

@maelvls
Copy link
Member

maelvls commented Mar 18, 2024

Before #9, we used to embed the certificate in a QR code as a URL. The URL led to a GitHub Pages hosted page that shows the certificate. The URL only contained the certificate. An example of this URL is https://cert-manager.github.io/print-your-cert/?asn1=MIICXDC...CAgOgA. This asn1 parameter was the URL-encoded base64-encoded (not wrapped with newlines) DER certificate.

Note

It is possible to turn the certificate back into PEM by running

echo "MIIDBzCCA...LMQswCQYD%0A" | urldecode | base64 -d | openssl asn1parse -inform DER

The benefit of this approach was that we didn't need to store the certificates anywhere. The downside is that the QR code was hard to read for QR code readers (for example, Google Lens).

Thanks to Ash's changes, the certificates' sizes were reduced and I noticed it was possible to fit the cert and key in less space than the old URLs.

URL size
Before (just cert) 892 chars
After (cert + key) 885 chars

In main...maelvls:print-your-cert:bigger-qr-code, I made the QR code label 10% bigger to see if it was easier to read:

IMG_4389 Large

Regardless, we chose to go with a URL that points to the Raspberry's UI, of the form:

https://print-your-cert.cert-manager.io/?certName=nMSUwIwYD...yIG1haW50YWluZ&fetchKey=XJzMB4XDTIyM...FowLDEqM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant