(c *cli.Context, fileName string, inputStore common.Store, outputStore common.Store, svcs []keyservice.KeyServiceClient, decryptionOrder []string)
| 2278 | } |
| 2279 | |
| 2280 | func getRotateOpts(c *cli.Context, fileName string, inputStore common.Store, outputStore common.Store, svcs []keyservice.KeyServiceClient, decryptionOrder []string) (rotateOpts, error) { |
| 2281 | kmsEncryptionContext := kms.ParseKMSContext(c.String("encryption-context")) |
| 2282 | addMasterKeys, err := getMasterKeys(c, kmsEncryptionContext, "add-kms", "add-pgp", "add-gcp-kms", "add-hckms", "add-azure-kv", "add-hc-vault-transit", "add-age") |
| 2283 | if err != nil { |
| 2284 | return rotateOpts{}, err |
| 2285 | } |
| 2286 | rmMasterKeys, err := getMasterKeys(c, kmsEncryptionContext, "rm-kms", "rm-pgp", "rm-gcp-kms", "rm-hckms", "rm-azure-kv", "rm-hc-vault-transit", "rm-age") |
| 2287 | if err != nil { |
| 2288 | return rotateOpts{}, err |
| 2289 | } |
| 2290 | return rotateOpts{ |
| 2291 | OutputStore: outputStore, |
| 2292 | InputStore: inputStore, |
| 2293 | InputPath: fileName, |
| 2294 | Cipher: aes.NewCipher(), |
| 2295 | KeyServices: svcs, |
| 2296 | DecryptionOrder: decryptionOrder, |
| 2297 | IgnoreMAC: c.Bool("ignore-mac"), |
| 2298 | AddMasterKeys: addMasterKeys, |
| 2299 | RemoveMasterKeys: rmMasterKeys, |
| 2300 | }, nil |
| 2301 | } |
| 2302 | |
| 2303 | func toExitError(err error) error { |
| 2304 | if cliErr, ok := err.(*cli.ExitError); ok && cliErr != nil { |
no test coverage detected