Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

(refactor) represent signatures as bytes #45

Open
japaric opened this issue Mar 12, 2024 · 0 comments
Open

(refactor) represent signatures as bytes #45

japaric opened this issue Mar 12, 2024 · 0 comments

Comments

@japaric
Copy link
Collaborator

japaric commented Mar 12, 2024

rather than as base64-encoded text.

this would make it easier to modify / recompute signature as it would avoid the need to manually use the base64 crate to do the decoding and re-encoding.

fields that would change

the base64 encoding would happen in the fmt::Display implementation where the RRSIG is transformed into text. whereas the base64 decoding would happen in the FromStr implementation, which parses the text representation of an RRSIG

example of code that would be simplified

let mut signature = BASE64_STANDARD.decode(&rrsig.signature)?;
let last = signature.last_mut().expect("empty signature");
*last = !*last;
rrsig.signature = BASE64_STANDARD.encode(&signature);

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

No branches or pull requests

1 participant