Documentation
¶
Index ¶
- Constants
- type HMACKeyProvider
- type HMACProvider
- func (h *HMACProvider) SHA256Sign(keyId string, data io.Reader) (string, error)
- func (h *HMACProvider) SHA256Verify(data io.Reader, hash string) (string, bool, error)
- func (h *HMACProvider) Sign256(keyId string, data io.Reader) (hash string, timestamp string, nonce string, err error)
- func (h *HMACProvider) Verify256(data io.Reader, hash string, timestamp string, nonce string) (string, bool, error)
- type HMACProviderOption
- type SingleKeyProvider
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HMACKeyProvider ¶ added in v0.6.0
type HMACKeyProvider interface {
FetchSecret(keyId string) (*secure.Credential, error)
}
HMACKeyProvider interface Note: userIds cannot contain dots!!! (".")
type HMACProvider ¶
type HMACProvider struct {
// contains filtered or unexported fields
}
func NewHmacProvider ¶
func NewHmacProvider(secretProvider HMACKeyProvider, opts ...HMACProviderOption) *HMACProvider
func (*HMACProvider) SHA256Sign ¶
SHA256Sign generate a simple SHA256 HMAC, no nounce, no timestamp
func (*HMACProvider) SHA256Verify ¶
SHA256Verify verify a simple SHA256 HMAC, no nounce, no timestamp the hash must be a hex-encoded sha256 hash returns the keyId (if any), true if is valid, and an optional error status
type HMACProviderOption ¶
type HMACProviderOption func(*HMACProvider)
func WithKeyInterval ¶
func WithKeyInterval(interval time.Duration) HMACProviderOption
func WithMaxInputSize ¶
func WithMaxInputSize(maxInputSize int) HMACProviderOption
func WithNonceStore ¶
func WithNonceStore(nonceStore store.NonceStore) HMACProviderOption
type SingleKeyProvider ¶ added in v0.6.0
type SingleKeyProvider struct {
// contains filtered or unexported fields
}
func NewSingleKeyProvider ¶ added in v0.6.0
func NewSingleKeyProvider(keyId string, secret *secure.Credential) *SingleKeyProvider
NewSingleKeyProvider creates a simple HMACKeyProvider that provides a single key
func (*SingleKeyProvider) FetchSecret ¶ added in v0.6.0
func (p *SingleKeyProvider) FetchSecret(keyId string) (*secure.Credential, error)
FetchSecret returns the secret if the keyId is valid
Click to show internal directories.
Click to hide internal directories.