mirror of
https://github.com/apple/swift-certificates
synced 2026-11-24 04:27:49 +00:00
* Simplify the internal representation of RDNAttribute.Value Motivation The 1.1.0 release included a patch (#154) that supported converting RDNAttribute values into strings. This patch missed that the `.any` case may also have strings in it. While investigating this limitation, I realised that the constructor function was excessively complex. While it attempted to coerce based on extra information in the ASN.1 specification, it always fell back into the `.any` case. This meant that as a practical matter we always took the same few paths, and so could safely simplify the code. Modifications Simplify DER decoding of RDNAttribute.Values. Introspect the .any cases for UTF8 strings and Printable strings when converting to String. Result Faster construction, more flexible representation. * normalise `RDN.Value.Storage` representation --------- Co-authored-by: Cory Benfield <lukasa@apple.com>