Documentation ¶
Index ¶
- Constants
- Variables
- func DecodePrivate(pemPrivate []byte) (privateKey *ecdsa.PrivateKey, err error)
- func DecodePublic(pemEncodedPub []byte) (*ecdsa.PublicKey, error)
- func EncodePrivate(privateKey *ecdsa.PrivateKey) (key []byte, err error)
- func EncodePublic(publicKey *ecdsa.PublicKey) (key []byte, err error)
- func New() (*ecdsa.PrivateKey, error)
- func NewToken(privateKey *ecdsa.PrivateKey, issuer string, expiry time.Time, ...) ([]byte, error)
- func WithAudience(audience []string) cfg.Option[JWT]
- func WithClaim(claim Claim) cfg.Option[JWT]
- func WithID(id string) cfg.Option[JWT]
- func WithNotBefore(notBefore time.Time) cfg.Option[JWT]
- func WithSubject(subject string) cfg.Option[JWT]
- type Claim
- type ECDSASigner
- type ECDSAVerifier
- type JWT
Constants ¶
Variables ¶
View Source
var ( ErrInvalidPEM = errs.WithDomain(errDomain, ErrInvalid, ErrPEM) ErrInvalidSignature = errs.WithDomain(errDomain, ErrInvalid, ErrSignature) ErrNilPrivateKey = errs.WithDomain(errDomain, ErrNil, ErrPrivateKey) ErrInvalidClaim = errs.WithDomain(errDomain, ErrInvalid, ErrClaim) )
Functions ¶
func DecodePrivate ¶
func DecodePrivate(pemPrivate []byte) (privateKey *ecdsa.PrivateKey, err error)
func EncodePrivate ¶
func EncodePrivate(privateKey *ecdsa.PrivateKey) (key []byte, err error)
func New ¶
func New() (*ecdsa.PrivateKey, error)
Types ¶
type ECDSASigner ¶
type ECDSASigner struct {
Priv *ecdsa.PrivateKey
}
type ECDSAVerifier ¶
func (ECDSAVerifier) Verify ¶
func (d ECDSAVerifier) Verify(hash, signature []byte) error
Click to show internal directories.
Click to hide internal directories.