Skip to content

Un-deprecate sign(), change naming sign_with_ref()#46

Merged
nresare merged 1 commit intomainfrom
api_simplification
Jul 12, 2025
Merged

Un-deprecate sign(), change naming sign_with_ref()#46
nresare merged 1 commit intomainfrom
api_simplification

Conversation

@nresare
Copy link
Owner

@nresare nresare commented Jul 12, 2025

Made Identity hold Box<Cow<>> instances for its variants instead of just Box<>, which enables holding a reference when that is what you pass in, avoiding needless copying.

I realised that most users of the signing API would probably just hold either a PublicKey or a Certificate, in which case the sign() signature makes complete sense. Calling it with a &PublicKey or &Certificate will do the right thing, and the cost of creating an Identity instance presumably very small. For the case where some calling code holds an Identity, it makes sense that one might not want that Identity to be needlessly moved into sign(), so for this case a separate method sign_with_ref() makes sense so that this value can be borrowed.

Made Identity hold Box<Cow<>> instances for its variants instead of
just Box<>, which enables holding a reference when that is what you
pass in, avoiding needless copying.
@nresare nresare merged commit c07991a into main Jul 12, 2025
2 checks passed
@nresare nresare deleted the api_simplification branch October 14, 2025 20:55
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

Successfully merging this pull request may close these issues.

1 participant