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 ( // ES256 is ECDSA using P-256 and SHA-256 ES256 = 1 // ES384 is ECDSA using P-384 and SHA-384 ES384 = 2 // ES512 is ECDSA using P-521 and SHA-512 ES512 = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider provides ECDSA using the NIST curves and SHA2 for JWS signing and verification
func LoadProvider ¶
LoadProvider returns a Provider using the supplied settings. The public key will be ignored as the settings include all necessary information.
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
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 signature settings for an EdDSA curve
func NewSettings ¶
NewSettings creates new signature settings for the parameters