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 ( // Ed25519 is a twisted Edwards curve designed by Daniel J. Bernstein et. al. with a 126-bit security level. Ed25519 = 1 // Ed448 is am Edwards curve designed by Mike Hamburg with a 223-bit security level. It's implementation in Go is currently not stable so use with care. Ed448 = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is a struct that stores all necessary data to sign and verify EdDSA signatures
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
func (Provider) Header ¶
func (p Provider) Header(h *jwt.Header)
Header sets the necessary JWT header fields for the default curve
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