-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make SignContent
struct or Signable
trait public
#222
Comments
I made |
Maybe expose (The reason |
Yes, that would be a nice and very usable API for me!
I saw the I'll put up a PR for this next. |
@mulmarta, would you be up for having a new method on /// Sign `data` using `secret_key` and `label`.
///
/// This implements [SignWithLabel][1]. The `label` can be used to
/// distinguish between signatures on the same `data` made in
/// different contexts.
///
/// [1]: https://www.rfc-editor.org/rfc/rfc9420.html#name-signing
async fn sign_with_label(
&self,
secret_key: &SignatureSecretKey,
label: &str,
data: &[u8],
) -> Result<Vec<u8>, Self::Error> {
let sign_content = SignContent::new(label, data).mls_encode_to_vec()?;
self.sign(&secret_key, &sign_content)
} The whole Alternatively, I can expose a new top-level function in /// Sign `data` using `secret_key` and `label`.
///
/// This implements [SignWithLabel][1]. The `label` can be used to
/// distinguish between signatures on the same `data` made in
/// different contexts.
///
/// [1]: https://www.rfc-editor.org/rfc/rfc9420.html#name-signing
async fn sign_with_label<P: CipherSuiteProvider>(
signature_provider: &P,
secret_key: &SignatureSecretKey,
label: &str,
data: &[u8],
) -> Result<Vec<u8>, MlsError> { Which approach do you like better? I think the second means moving less code around, so it might fit better with the current layering of mls-rs vs mls-rs-core. |
Sorry @mgeisler we're a bit under water at the moment. I like approach 1 better, somehow sign-with-label conceptually fits more in the crypto provider part. You could use it without using MLS FWIW. I don't know why |
Description of feature:
We would like to use the
SignWithLabel
andVerifyWithLabel
functionality from Section 5.1.2 with our data.Implementation discussion (Optional)
I did this internally with this simple code:
This is a trimmed down version of the functionality used by the
Signable
trait.Do you think we could make either the full trait public, or make a
SignContent
struct available?Thanks for considering!
The text was updated successfully, but these errors were encountered: