Documentation ¶
Index ¶
Constants ¶
const ( PEMBlockTypePrivateKey = "PRIVATE KEY" PEMBlockTypePublicKey = "PUBLIC KEY" )
Variables ¶
var ( // ErrNotSupported is returned when t he signing key is not supported ErrNotSupported errNotSupported // ErrSigningKeyInvalid is returned when the signing key config is invalid ErrSigningKeyInvalid errSigningKeyInvalid // ErrVerifierKeyInvalid is returned when the verifier key config is invalid ErrVerifierKeyInvalid errVerifierKeyInvalid )
Functions ¶
Types ¶
type SigningKey ¶
type SigningKey interface { Alg() string Private() any Verifier() VerifierKey }
SigningKey is a signing key interface
func SigningKeyFromParams ¶
func SigningKeyFromParams(params string, signingKeys SigningKeyAlgs) (SigningKey, error)
SigningKeyFromParams creates a cipher from params
type SigningKeyAlgs ¶
type SigningKeyAlgs interface { Register(b SigningKeyBuilder) Get(id string) (SigningKeyBuilder, bool) }
SigningKeyAlgs are a map of valid signing keys
type SigningKeyBuilder ¶
type SigningKeyBuilder interface { ID() string Build(params string) (SigningKey, error) }
SigningKeyBuilder constructs a new signing key from params
type SigningKeyring ¶
type SigningKeyring struct {
// contains filtered or unexported fields
}
SigningKeyring holds signing keys
func NewSigningKeyring ¶
func NewSigningKeyring() *SigningKeyring
NewSigningKeyring creates a new signing keyring
func (*SigningKeyring) Get ¶
func (s *SigningKeyring) Get(id string) (SigningKey, bool)
Get gets a registered signing key by id
func (*SigningKeyring) Register ¶
func (s *SigningKeyring) Register(k SigningKey)
Register registers a signing key
func (*SigningKeyring) Size ¶
func (s *SigningKeyring) Size() int
Size returns the number of registered signing keys
type SigningKeysMap ¶
type SigningKeysMap struct {
// contains filtered or unexported fields
}
func NewSigningKeysMap ¶
func NewSigningKeysMap() *SigningKeysMap
func (*SigningKeysMap) Get ¶
func (m *SigningKeysMap) Get(id string) (SigningKeyBuilder, bool)
func (*SigningKeysMap) Register ¶
func (m *SigningKeysMap) Register(b SigningKeyBuilder)
type VerifierKey ¶
VerifierKey is a verifier key interface
func VerifierKeyFromParams ¶
func VerifierKeyFromParams(params string, verifierKeys VerifierKeyAlgs) (VerifierKey, error)
VerifierKeyFromParams creates a verifier from params
type VerifierKeyAlgs ¶
type VerifierKeyAlgs interface { Register(b VerifierKeyBuilder) Get(id string) (VerifierKeyBuilder, bool) }
VerifierKeyAlgs are a map of valid verifier keys
type VerifierKeyBuilder ¶
type VerifierKeyBuilder interface { ID() string Build(params string) (VerifierKey, error) }
VerifierKeyBuilder constructs a new verifier key from params
type VerifierKeyring ¶
type VerifierKeyring struct {
// contains filtered or unexported fields
}
VerifierKeyring holds verifier keys
func NewVerifierKeyring ¶
func NewVerifierKeyring() *VerifierKeyring
NewVerifierKeyring creates a new verifier keyring
func (*VerifierKeyring) Get ¶
func (s *VerifierKeyring) Get(id string) (VerifierKey, bool)
Get gets a registered verifier key by id
func (*VerifierKeyring) Register ¶
func (s *VerifierKeyring) Register(k VerifierKey)
Register registers a verifier key
func (*VerifierKeyring) Size ¶
func (s *VerifierKeyring) Size() int
Size returns the number of registered verifier keys
type VerifierKeysMap ¶
type VerifierKeysMap struct {
// contains filtered or unexported fields
}
func NewVerifierKeysMap ¶
func NewVerifierKeysMap() *VerifierKeysMap
func (*VerifierKeysMap) Get ¶
func (m *VerifierKeysMap) Get(id string) (VerifierKeyBuilder, bool)
func (*VerifierKeysMap) Register ¶
func (m *VerifierKeysMap) Register(b VerifierKeyBuilder)