Files
Cory Benfield 54b9711034 Avoid re-serializing certificates (#35)
When we decode a certificate, we produce an in-memory representation.
This representation is something we are capable of encoding. If we
re-encode that directly, we can produce an output that is different to
the one we injested. This happens when there are objects that can be
canonicalised, such as replacing an explicit ASN1 NULL with an absent
field where both are considered equivalent.

This patch rewrites the code to ensure that we preserve the bytes of the
certificate that we deserialized. This allows us to write them back
unchanged, ensuring that certificates can round-trip through this
library without modification.

A side-effect of this change is that we need to essentially encode the
certificate on construction whenever we build them in memory. That's not
a big deal, but it is a bit of an annoyance.
2023-03-08 13:30:34 +00:00
..
2023-03-02 14:11:09 -08:00