Documentation ¶
Index ¶
- Variables
- func Parse(jwt string) (headerEncoded, payloadEncoded, signatureEncoded string, err error)
- func Sign(alg string, keyOpt SigningKeyOption, signingInput string) (signatureEncoded string, err error)
- func Verify(keyOption VerificationKeyOption, jwt string) (header *jose.Header, err error)
- type SigningKeyOption
- type VerificationKeyOption
- func UseECDSAKey(key *ecdsa.PublicKey) VerificationKeyOption
- func UseHMACKey(key []byte) VerificationKeyOption
- func UseJSONWebKey() VerificationKeyOption
- func UseJWKSetURL(ctx context.Context, jwkSetURL string) VerificationKeyOption
- func UseJWKSetURLHeaderParameter(ctx context.Context) VerificationKeyOption
- func UseKey(key any) VerificationKeyOption
- func UseRSAKey(key *rsa.PublicKey) VerificationKeyOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidTokenReceived = errors.New(`jws: invalid token received, token must have 3 parts`) ErrInvalidKeyOption = errors.New(`jws: invalid key option`) )
Functions ¶
Types ¶
type SigningKeyOption ¶
type SigningKeyOption struct {
// contains filtered or unexported fields
}
func WithECDSAKey ¶
func WithECDSAKey(key *ecdsa.PrivateKey) SigningKeyOption
func WithHMACKey ¶
func WithHMACKey(key []byte) SigningKeyOption
func WithKey ¶
func WithKey(key any) SigningKeyOption
func WithRSAKey ¶
func WithRSAKey(key *rsa.PrivateKey) SigningKeyOption
type VerificationKeyOption ¶
type VerificationKeyOption struct {
// contains filtered or unexported fields
}
func UseECDSAKey ¶
func UseECDSAKey(key *ecdsa.PublicKey) VerificationKeyOption
func UseHMACKey ¶
func UseHMACKey(key []byte) VerificationKeyOption
func UseJSONWebKey ¶
func UseJSONWebKey() VerificationKeyOption
func UseJWKSetURL ¶
func UseJWKSetURL(ctx context.Context, jwkSetURL string) VerificationKeyOption
UseJWKSetURL is a VerificationKeyOption to verify with jwkSetURL.
func UseJWKSetURLHeaderParameter ¶
func UseJWKSetURLHeaderParameter(ctx context.Context) VerificationKeyOption
func UseKey ¶
func UseKey(key any) VerificationKeyOption
func UseRSAKey ¶
func UseRSAKey(key *rsa.PublicKey) VerificationKeyOption
Click to show internal directories.
Click to hide internal directories.