MCPcopy
hub / github.com/smallstep/cli / keysetRemoveAction

Function keysetRemoveAction

command/crypto/jwk/keyset.go:160–182  ·  view source on GitHub ↗
(ctx *cli.Context)

Source from the content-addressed store, hash-verified

158}
159
160func keysetRemoveAction(ctx *cli.Context) error {
161 if err := errs.NumberOfArguments(ctx, 1); err != nil {
162 return err
163 }
164
165 kid := ctx.String("kid")
166
167 jwksFile := ctx.Args().Get(0)
168 jwks, writeFunc, err := rwLockKeySet(jwksFile)
169 if err != nil {
170 return err
171 }
172
173 // Filtering without allocating
174 keys := jwks.Keys[:0]
175 for _, key := range jwks.Keys {
176 if key.KeyID != kid {
177 keys = append(keys, key)
178 }
179 }
180 jwks.Keys = keys
181 return writeFunc(true)
182}
183
184func keysetListAction(ctx *cli.Context) error {
185 if err := errs.NumberOfArguments(ctx, 1); err != nil {

Callers

nothing calls this directly

Calls 2

rwLockKeySetFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…