jws

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

A minimal implementation of JSON Web Signatures (JWS) with ECDSA or RSA keys

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWS

type JWS struct {
	Protected string `json:"protected"`
	Payload   string `json:"payload"`
	Signature string `json:"signature"`
}

Represents a JSON Web Signature (JWS) document

func Sign

func Sign(payload []byte, headerParams map[string]any, signer crypto.Signer) (*JWS, error)

func (*JWS) Compact

func (jws *JWS) Compact() string

func (*JWS) UnmarshalProtected

func (jws *JWS) UnmarshalProtected(value any) error

Unmarshal the protected header into value

func (*JWS) Verify

func (jws *JWS) Verify(key crypto.PublicKey) error

Jump to

Keyboard shortcuts

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