Documentation
¶
Index ¶
- type Keygrip
- func (kg *Keygrip) AddKey(key string)
- func (kg *Keygrip) Index(data, digest []byte) int
- func (kg *Keygrip) Keys() []string
- func (kg *Keygrip) RemoveKey(key string)
- func (kg *Keygrip) SetKeys(keys []string)
- func (kg *Keygrip) Sign(data []byte) []byte
- func (kg *Keygrip) Verify(data, digest []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keygrip ¶
type Keygrip struct {
// contains filtered or unexported fields
}
Keygrip keygrip struct
func NewRWMutex ¶ added in v1.2.0
NewRWMutex returns a new keygrip protected by an RWMutex for concurrent use.
func (*Keygrip) AddKey ¶
AddKey adds the key to the front of the key list (preferred for signing). If the key already exists, this is a no-op.
func (*Keygrip) Index ¶
Index returns the index of the key which matches digest. It returns -2 if the digest is not valid base64.RawURLEncoding. It returns -1 if no key matches the digest (including wrong-length digests).
func (*Keygrip) RemoveKey ¶
RemoveKey removes the key from the key list. Missing keys are ignored. The last remaining key is never removed (no-op) so Sign always has a credential.
func (*Keygrip) SetKeys ¶ added in v1.2.1
SetKeys replaces the entire key list. keys must not be empty.