jwks

package
v1.39.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RSAAlgorithm       = "RSA"
	RSAExponentAQAB    = "AQAB"
	RSAExponentAAEAAQ  = "AAEAAQ"
	RSADefaultExponent = 65537
)

Variables

This section is empty.

Functions

This section is empty.

Types

type JWKS

type JWKS struct {
	Keys []JsonKey `json:"keys"`
}

func (JWKS) DoGetJWKS

func (j JWKS) DoGetJWKS(ctx context.Context) JWKSInt

DoGetJWKS return package interface

func (JWKS) GetJWKSRSAKeys added in v1.38.0

func (j JWKS) GetJWKSRSAKeys(awsRegion string, poolID string) (map[string]string, error)

GetJWKSRSAKeys retrieves the JWKS RSA keys which are consumed by the authorisation middleware on startup.

func (JWKS) JWKSGetKeyset

func (j JWKS) JWKSGetKeyset(awsRegion, poolId string) (*JWKS, error)

JWKSGetKeyset primary package method which retrives the json web key set for cognito user pool

func (JWKS) JWKSToRSA added in v1.38.0

func (j JWKS) JWKSToRSA(jwks *JWKS) (map[string]string, error)

JWKSToRSA method returns a map of the JWKS RSA Public keys

func (JWKS) JWKSToRSAJSONResponse

func (j JWKS) JWKSToRSAJSONResponse(jwks *JWKS) ([]byte, error)

JWKSToRSAJSONResponse method returns byte[] array for request response

func (JWKS) JWKToRSAPublicKey

func (j JWKS) JWKToRSAPublicKey(jwk JsonKey) (string, error)

JWKToRSAPublicKey transforms key data to PKIX, ASN.1 DER form

type JWKSInt

type JWKSInt interface {
	JWKSGetKeyset(awsRegion, poolId string) (*JWKS, error)
	JWKSToRSAJSONResponse(jwks *JWKS) ([]byte, error)
}

type JsonKey

type JsonKey struct {
	E   string `json:"e"`
	Kid string `json:"kid"`
	Kty string `json:"kty"`
	N   string `json:"n"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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