Documentation ¶
Index ¶
- Constants
- type Provider
- func (p *Provider) AddPublicKey(key publickey.PublicKey) error
- func (p Provider) CurrentKey() publickey.PublicKey
- func (p Provider) Header(h *jwt.Header)
- func (p *Provider) RemovePublicKey(keyid string)
- func (p Provider) Sign(c []byte) ([]byte, error)
- func (p Provider) Verify(data, sig []byte, h jwt.Header) error
- type Settings
Constants ¶
const ( // HS256 is HMAC-SHA256 HS256 = 1 // HS384 is HMAC-SHA384 HS384 = 2 // HS512 is HMAC-SHA512 HS512 = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider provides HMAC-SHA2 JWS signing and verification
func LoadProvider ¶
LoadProvider returns a Provider using the supplied keypairs
func NewProvider ¶
NewProvider creates a new Provider generating the necessary keypairs
func NewProviderWithKeyURL ¶
NewProviderWithKeyURL works just like NewProvider but also sets the key URL of the generated keys
func (*Provider) AddPublicKey ¶
AddPublicKey adds a public key for verification
func (Provider) CurrentKey ¶
CurrentKey returns the public key belonging to the private key used for signing. CAUTION: The public and private key are the same for this algorithm. Do not share the key you obtain using this function
func (Provider) Header ¶
func (p Provider) Header(h *jwt.Header)
Header sets the necessary JWT header fields
func (*Provider) RemovePublicKey ¶
RemovePublicKey removes a public key by it's key ID from the verification set
type Settings ¶
type Settings struct {
// contains filtered or unexported fields
}
Settings stores the key for an algorithm
func NewSettings ¶
NewSettings creates new signature settings for the parameters