jwk

package
v0.0.0-...-16b56c3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWK

type JWK struct {
	Kty       string           `json:"kty"`
	Crv       string           `json:"crv"`
	X         string           `json:"x"`
	Y         string           `json:"y"`
	PublicKey *ecdsa.PublicKey `json:"-"`
}

JWK represents a JSON Web Key

func FromJSON

func FromJSON(jwkString string) JWK

FromJSON from json string to JWK

func (*JWK) FromECPublicKey

func (obj *JWK) FromECPublicKey(publicKey *ecdsa.PublicKey) *JWK

FromECPublicKey creates JWK from elliptic curve public key

func (*JWK) GenerateECKey

func (obj *JWK) GenerateECKey() *ecdsa.PrivateKey

GenerateECKey generate ECDSA key pair using secp256r1 curve

func (*JWK) ToECPublicKey

func (obj *JWK) ToECPublicKey() *ecdsa.PublicKey

ToECPublicKey to ECDSA public key

func (*JWK) ToJSON

func (obj *JWK) ToJSON() string

ToJSON to json string

Jump to

Keyboard shortcuts

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