jwk

package
v0.0.0-...-64dd8ac Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 16 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidKey = errors.New("invalid JWK")

ErrInvalidKey is returned when passed JWK is invalid.

Functions

This section is empty.

Types

type JWK

type JWK struct {
	jose.JSONWebKey

	Kty string
	Crv string
}

JWK (JSON Web Key) is a JSON data structure that represents a cryptographic key.

func (*JWK) KeyType

func (j *JWK) KeyType() (kms.KeyType, error)

KeyType returns the kms KeyType of the JWK, or an error if the JWK is of an unrecognized type.

func (*JWK) MarshalJSON

func (j *JWK) MarshalJSON() ([]byte, error)

MarshalJSON serializes the given key to its JSON representation.

func (*JWK) PublicKeyBytes

func (j *JWK) PublicKeyBytes() ([]byte, error)

PublicKeyBytes converts a public key to bytes. Note: the Public() member function is in go-jose, this means keys not supported by go-jose are not supported using j.Public(). Instead use this function to get the public raw bytes.

func (*JWK) UnmarshalJSON

func (j *JWK) UnmarshalJSON(jwkBytes []byte) error

UnmarshalJSON reads a key from its JSON representation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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