Skip to content

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

@maelvls

Description

@maelvls

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions