@@ -57,10 +57,13 @@ const (
5757type Set interface {
5858 // Add adds the specified key. If the key already exists in the set, it is
5959 // not added.
60+ // This method will be renamed to `AddKey(Key)` in a future major release.
6061 Add (Key ) bool
6162
6263 // Clear resets the list of keys associated with this set, emptying the
6364 // internal list of `jwk.Key`s
65+ // This method will be changed in the future to clear all contents in the
66+ // `jwk.Set` instead of just the keys.
6467 Clear ()
6568
6669 // Get returns the key at index `idx`. If the index is out of range,
@@ -69,11 +72,23 @@ type Set interface {
6972 Get (int ) (Key , bool )
7073
7174 // Field returns the value of a private field in the key set.
75+ //
7276 // For the purposes of a key set, any field other than the "keys" field is
73- // considered to be a private field.
77+ // considered to be a private field. In other words, you cannot use this
78+ // method to directly access the list of keys in the set
79+ //
7480 // This method will be renamed to `Get(string)` in a future major release.
7581 Field (string ) (interface {}, bool )
7682
83+ // Set sets the value of a single field.
84+ //
85+ // This method, which takes an `interface{}`, exists because
86+ // these objects can contain extra _arbitrary_ fields that users can
87+ // specify, and there is no way of knowing what type they could be.
88+ Set (string , interface {}) error
89+
90+ // Remove removes the field associated with the specified key.
91+ // There is no way to remove the `kty` (key type). You will ALWAYS be left with one field in a jwk.Key.
7792 // Index returns the index where the given key exists, -1 otherwise
7893 Index (Key ) int
7994
0 commit comments