jwk

package
v0.0.0-...-9e627aa Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedKeyType = errors.New("unsupported key type")

Functions

func WithAlgorithm

func WithAlgorithm(algorithm jwa.Algorithm) func(*Key)

func WithId

func WithId(id string) func(*Key)

func WithOperations

func WithOperations(operations ...Operation) func(*Key)

func WithPublicKeyUse

func WithPublicKeyUse(publicKeyUse PublicKeyUse) func(*Key)

func WithX509CertificateChain

func WithX509CertificateChain(chain []*x509.Certificate) func(*Key)

func WithX509CertificateSHA1Thumbprint

func WithX509CertificateSHA1Thumbprint(thumbprint string) func(*Key)

func WithX509CertificateSHA256Thumbprint

func WithX509CertificateSHA256Thumbprint(thumbprint string) func(*Key)

func WithX509Url

func WithX509Url(url *url.URL) func(*Key)

Types

type Key

type Key struct {
	// contains filtered or unexported fields
}

func NewKey

func NewKey(material any, options ...func(*Key)) *Key

func (*Key) MarshalJSON

func (key *Key) MarshalJSON() ([]byte, error)

func (*Key) Material

func (key *Key) Material() any

func (*Key) UnmarshalJSON

func (key *Key) UnmarshalJSON(data []byte) error

type KeySet

type KeySet struct {
	Keys []*Key `json:"keys"`
}

func NewKeySet

func NewKeySet(keys ...*Key) *KeySet

func (*KeySet) Key

func (keySet *KeySet) Key(publicKeyUse PublicKeyUse, operations []Operation, algorithm jwa.Algorithm, id string) *Key

type MissingRequiredParameterError

type MissingRequiredParameterError struct {
	// contains filtered or unexported fields
}

func (MissingRequiredParameterError) Error

func (error MissingRequiredParameterError) Error() string

type Operation

type Operation string
const (
	Sign       Operation = "sign"
	Verify     Operation = "verify"
	Encrypt    Operation = "encrypt"
	Decrypt    Operation = "decrypt"
	WrapKey    Operation = "wrapKey"
	UnwrapKey  Operation = "unwrapKey"
	DeriveKey  Operation = "deriveKey"
	DeriveBits Operation = "deriveBits"
)

type PublicKeyUse

type PublicKeyUse string
const (
	Signature  PublicKeyUse = "sig"
	Encryption PublicKeyUse = "enc"
)

type Type

type Type string
const (
	EllipticCurve Type = "EC"
	RSA           Type = "RSA"
	OctetSequence Type = "oct"
)

Jump to

Keyboard shortcuts

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