-
Notifications
You must be signed in to change notification settings - Fork 13
Add support for Tink keyset signer #563
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
base: main
Are you sure you want to change the base?
Add support for Tink keyset signer #563
Conversation
|
Reopening, ref to #282 for the previous discussion. |
This PR adds support for in-memory signing using a Tink keyset. The keyset is encrypted with a key-encryption-key stored in GCP KMS. The key is decrypted on startup and loaded into memory. This uses a utility to unpack the keyset into a crypto.Signer so that it can be used to sign certificates. This also validates that the key is an ECDSA P-256 key as per RFC 6962, since Tink supports many key types. Signed-off-by: Hayden <[email protected]>
9286b5a to
76ff1a7
Compare
|
Bumping this, is there any interest in supporting this at this time? |
| // primary key. | ||
| // | ||
| // NOTE: Tink validates keys on [keyset.Handle] creation. | ||
| func KeyHandleToSigner(kh *keyset.Handle) (crypto.Signer, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid opening the objets and doing curve operations, do you think that it would be possible to wrap an object around the keyset.Handle, which itself would implement crypto.Signer, and calls Tink's methods directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mentioned this in #282 (comment), the issue is that keyset.Handle takes in the pre-image while crypto.Signer takes in the digest. I'd like to simplify this, but we'd need Tink to implement a prehashed signer.
|
Sorry that this is taking a while - Secure Key management is on the roadmap for Beta, we just haven't had the time to get to it properly yet. We'll get to this before the end of Q4 / Q1 as we get closer to Beta. There are a few sticking point that we'd like to resolve before making a final decision on whether we need Tink, or whether we can simply use the standard Go crypto library primitives. Specifically, we'd like to do a proper tradeoff analysis given that I don't necessarily think TesseraCT needs some of Tink's star features as I understand it: keysets, key rotation, multi-language. At the moment, TesseraCT also uses two type of key APIs internally (to sign checkpoints, and to sign SCTs), so I'd like to take this as an opportunity to clean things a bit before adding a third API. In the meantime, I've popped a comment on something that could maybe be improved if we merged that PR. |
This PR adds support for in-memory signing using a Tink keyset. The keyset is encrypted with a key-encryption-key stored in GCP KMS. The key is decrypted on startup and loaded into memory. This uses a utility to unpack the keyset into a crypto.Signer so that it can be used to sign certificates. This also validates that the key is an ECDSA P-256 key as per RFC 6962, since Tink supports many key types.