Skip to content
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

dyn Signer is not Send #680

Open
kornelski opened this issue Nov 15, 2024 · 3 comments
Open

dyn Signer is not Send #680

kornelski opened this issue Nov 15, 2024 · 3 comments
Assignees

Comments

@kornelski
Copy link

I'm struggling to integrate the SDK in a multi-threaded application, because create_signer::from_keys returns Box<dyn Signer>. This trait does not require Sync implementation, which means that the signer is forever tied to the thread it's been created on.

It'd be ideal if it was Box<dyn Signer + Send + Sync>, but Box<dyn Signer + Send> will work too (it can be put in a Mutex).

Alternatively, if you made EdSigner public, I would use that type directly.

@gpeacock
Copy link
Collaborator

We should add some tests for multithreaded Rust clients to catch cases like this. I'll look into the fix or exporting EdSigner. FYI, CallbackSigner exports ed25519_sign

@gpeacock
Copy link
Collaborator

We are trying to move away from signing operations that require embedding a private key. CallbackSigner uses the public key to generated the signature and then calls back to a function to sign with a private key. That function can be implemented with KMS or other secure storage.

@gpeacock gpeacock self-assigned this Nov 15, 2024
@kornelski
Copy link
Author

BTW, please be specific in the documentation what format the key must be in. PEM isn't obvious, especially that such argument requires parsing the file over and over again. An Ed25519 signing function could be taking just 32-byte raw key material.

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

No branches or pull requests

2 participants