I’m just testing out the key rotation in a proof of concept so I’m using the local key provider. I create my NewClientEncryption using the existing master key and then I’m trying to rotate to a new one using RewrapManyDataKey. I’m a little confused on what the RewrapManyDataKey options are expecting.
I tried giving it the new master key like this:
rwo := options.RewrapManyDataKey().
SetProvider("local").
SetMasterKey(bson.M{"masterKey": "<new key>"})
but then I get an error saying error="mongocrypt error 1: Unexpected field: 'masterKey'".
What is the SetMasterKey option expecting? I tried it with just the string and it errored because that’s not a valid bson document.
Is local key rotation supported? The docs seem to only mention it for Azure, GCP, and AWS.