Help us shape the future of Go! Take the 2026 Go Developer Survey

joseutil

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyTypeRSA = "RSA"

	// The RSASSA-PKCS1-v1_5 signature algorithms supported for key generation,
	// signing and verification.
	AlgRS256 = "RS256"
	AlgRS384 = "RS384"
	AlgRS512 = "RS512"
)

Variables

This section is empty.

Functions

func GenerateJWK

func GenerateJWK(alg, use, id string) (*jwk.Jwk, error)

func Sign

func Sign(privateJwk *jwktype.Jwk, payload []byte) ([]byte, error)

Sign creates a JWS signature for the provided payload using the specified key

func ValidatePrivKey

func ValidatePrivKey(j *jwk.Jwk) error

ValidatePrivKey validates the private key fields of the JWK according to its algorithm.

func ValidatePubKey

func ValidatePubKey(j *jwk.Jwk) error

ValidatePubKey validates the public key fields of the JWK according to its algorithm.

func Verify

func Verify(publicJwk *jwktype.Jwk, signedPayload []byte) ([]byte, error)

Verify checks if a JWS signature is valid using the specified public key

Types

This section is empty.

Jump to

Keyboard shortcuts

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