Check EAB key exists before deleting it
This commit is contained in:
parent
9d09f5e575
commit
a1afbce50c
1 changed files with 6 additions and 2 deletions
|
@ -222,9 +222,13 @@ func (db *DB) GetExternalAccountKey(ctx context.Context, provisionerName string,
|
|||
}
|
||||
|
||||
func (db *DB) DeleteExternalAccountKey(ctx context.Context, keyID string) error {
|
||||
err := db.db.Del(externalAccountKeyTable, []byte(keyID))
|
||||
_, err := db.db.Get(externalAccountKeyTable, []byte(keyID))
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "error deleting ACME EAB Key with Key ID: %s", keyID)
|
||||
return errors.Wrapf(err, "error loading ACME EAB Key with Key ID %s", keyID)
|
||||
}
|
||||
err = db.db.Del(externalAccountKeyTable, []byte(keyID))
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "error deleting ACME EAB Key with Key ID %s", keyID)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue