-
Notifications
You must be signed in to change notification settings - Fork 6
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
v2.3.0 Removed APIs Break my App #26
Comments
Hi @theory,
For ks := // some keyset
for i := 0; i < ks.Len(); i++ {
e, err := ks.Entry(i);
status := e.KeyStatus()
keyID := e.KeyID()
switch actualKey := k.(type) {
case *aesgcm.Key:
params := actualKey.Parameters().(*aesgcm.Parameters)
// Can have access to the paramters, such as key size, IV size and TAG size.
case *aesgcmsiv.Key: ...
}
} We are planning to add similar types for other primitives as well. Would that help?
Can these be two different (existing) keys or do they have to be one key? An option could be registering a key manager that creates |
Hi @morambro
Yes, I believe so, as long as it iterates over all keys, not just active keys. I assume it's a pretty straightforward interface to implement, yes?
Not really; they're tightly linked in my app. It's fine that they're internally two keys; like I said, The photo is pretty simple: message MyKey {
uint32 version = 1;
// Tracks the AEAD and Mac schemes used by this key.
HarkParams params = 2;
// Stores the AEAD key material and configuration.
google.crypto.tink.KeyData aead_key_data = 3;
// Stores the MAC key material and configuration.
google.crypto.tink.KeyData mac_key_data = 4;
} An option could be registering a key manager that creates That's essentially how it's implemented now, though it uses templates, so relies on But because I implemented MyKey using all of Tinks' patterns, including protobuf, the implementation of the methods that actually do encryption, decryption, and hashing needs to get at the underlying primitive set. I assume that anyone implementing their own key would need to so, as well. |
From the v2.3.0 release notes:
I have an app that relies on
primitiveset.PrimitiveSet
andkeyset.PrimitivesWithKeyManager
. I suspect many implementing their own keys might have a challenge, but because my app creates a key that simply encapsulates an AEAD key and a MAC key they're fairly essential.keyset.PrimitivesWithKeyManager
UsageAs described in #14 and #16, my app generates custom key info on output. It depends on
keyset.PrimitivesWithKeyManager
to get at the key info it needs, similar to this (error handling omitted for clarity):primitiveset.PrimitiveSet
UsageMy app's custom keys are a fairly straightforward bundling of an AEAD and MAC key as a single notional "key". It provides an interface that includes the functionality of both AEAD and MAC keys. To do so, the implementation simply wraps the underlying
primitiveset.PrimitiveSet
to get at the key material required for its functionality, more or less like so (error handling omitted for clarity):There's are also
Decrypt
method, naturally. Hopefully this makes it fairly clear what my use case is.The text was updated successfully, but these errors were encountered: