jwk

package
v1.20220411.3 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KTYRSA = "RSA"
)

KTY parameter values as defined in https://tools.ietf.org/html/rfc7518#section-6.1

Variables

This section is empty.

Functions

This section is empty.

Types

type JWK

type JWK struct {
	KTY string `json:"kty"`
	USE string `json:"use,omitempty"`
	ALG string `json:"alg,omitempty"`
	KID string `json:"kid,omitempty"`
	E   string `json:"e,omitempty"`
	N   string `json:"n,omitempty"`
}

JWK represents a cryptographic key as defined by https://tools.ietf.org/html/rfc7517#section-4

func RSAPublicKeyToJWK

func RSAPublicKeyToJWK(key *rsa.PublicKey) JWK

RSAPublicKeyToJWK converts an RSA public key to a JWK.

func (JWK) RSAPublicKey

func (j JWK) RSAPublicKey() (*rsa.PublicKey, error)

RSAPublicKey parses the public key in the JWK to a rsa.PublicKey.

type Set

type Set struct {
	Keys []JWK `json:"keys"`
}

Set represents a set of JWKs as defined by https://tools.ietf.org/html/rfc7517#section-5

Jump to

Keyboard shortcuts

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