jwt

package
v0.0.0-...-c80c473 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//BearerAuthHeader - authorization header name for bearer token
	BearerAuthHeader string = "Authorization"

	//BearerExpiry - key for token expiry
	BearerExpiry string = "expiry"
)

Variables

This section is empty.

Functions

func GetPKCS1PublicKeyFromPEMBytes

func GetPKCS1PublicKeyFromPEMBytes(inp []byte) (*rsa.PublicKey, error)

GetPKCS1PublicKeyFromPEMBytes - reads the public key from bytes

func ParseBase64EncodedRSAPublicKey

func ParseBase64EncodedRSAPublicKey(key string) (*rsa.PublicKey, error)

ParseBase64EncodedRSAPublicKey - parse base64 encoded rsa public key

Types

type EncodingType

type EncodingType string

EncodingType - types of encoding supported

const (
	//Base64 - base64 encoding/decoding will be used
	Base64 EncodingType = "base64"
)

type RSADecode

type RSADecode struct {
	PublicKey             string
	Algorithm             jwa.SignatureAlgorithm
	PublicKeyEncodingType EncodingType
}

RSADecode - object which implements the jwt token

func (RSADecode) InstrumentJWTBearerToken

func (decode RSADecode) InstrumentJWTBearerToken(next http.HandlerFunc) http.HandlerFunc

InstrumentJWTBearerToken - sets the jwt claims to the context headers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL