* * @param {string} bucketKeyId - the Id of the bucket key * @param {object} log - logger object * @param {function} cb - callback * @returns {undefined} * @callback called with (err)
(bucketKeyId, log, cb)
| 295 | * @callback called with (err) |
| 296 | */ |
| 297 | static destroyBucketKey(bucketKeyId, log, cb) { |
| 298 | log.debug('deleting bucket key', { bucketKeyId }); |
| 299 | // shadowing global client for key |
| 300 | const { error, client, implName, key } = getClientForKey(bucketKeyId, log); |
| 301 | if (error) { |
| 302 | return cb(error); |
| 303 | } |
| 304 | return client.destroyBucketKey(key, log, err => { |
| 305 | if (err) { |
| 306 | log.debug('error from kms', { implName, error: err }); |
| 307 | return cb(err); |
| 308 | } |
| 309 | log.trace('bucket key destroyed in kms'); |
| 310 | return cb(null); |
| 311 | }); |
| 312 | } |
| 313 | |
| 314 | /** |
| 315 | * createCipherBundle |
no test coverage detected