jwktypes

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package jwktypes contains types used by the package jwk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanUseFor

func CanUseFor(key any, op KeyOp) bool

Types

type KeyOp

type KeyOp string

KeyOp is type of "key_ops" JWK parameter defined in RFC 7517 Section 4.3.

const (
	// KeyOpSign is used for computing digital signature or MAC.
	KeyOpSign KeyOp = "sign"

	// KeyOpVerify is used for verifying digital signature or MAC
	KeyOpVerify KeyOp = "verify"

	// KeyOpVerify is used for encrypting content
	KeyOpEncrypt KeyOp = "encrypt"

	// KeyOpDecrypt is used for decrypt content and validate decryption, if applicable
	KeyOpDecrypt KeyOp = "decrypt"

	// KeyOpWrapKey is used for encrypt key
	KeyOpWrapKey KeyOp = "wrapKey"

	// KeyOpUnwrapKey is used for decrypt key and validate decryption, if applicable
	KeyOpUnwrapKey KeyOp = "unwrapKey"

	// KeyOpDeriveKey is used for deriving key
	KeyOpDeriveKey KeyOp = "deriveKey"

	// KeyOpDeriveBits is used for deriving bits not to be used as a key
	KeyOpDeriveBits KeyOp = "deriveBits"
)

type KeyUse

type KeyUse string

KeyUse is type of "use" JWK parameter defined in RFC 7517 Section 4.2.

const (
	KeyUseUnknown KeyUse = ""

	// KeyUseSig is the value used in the headers to indicate that
	// this key should be used for signatures.
	KeyUseSig KeyUse = "sig"

	// KeyUseEnc is the value used in the headers to indicate that
	// this key should be used for encrypting.
	KeyUseEnc KeyUse = "enc"
)

func (KeyUse) String

func (use KeyUse) String() string

Jump to

Keyboard shortcuts

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