jws

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportPrivateKey

func ExportPrivateKey(pk *rsa.PrivateKey) ([]byte, error)

func ExportPublicKey

func ExportPublicKey(pk *rsa.PrivateKey) ([]byte, error)

func NewHMacSigner

func NewHMacSigner(secret []byte) (jose.Signer, error)

NewHMacSigner instantiates a signer using HMAC using SHA-512 with the given private key.

func NewPublicKeyFromPEM

func NewPublicKeyFromPEM(pk []byte) (*rsa.PublicKey, error)

func NewRandomRSAKey

func NewRandomRSAKey() (*rsa.PrivateKey, error)

NewRandomRSAKey generates a public/private key pair

func NewRandomSymmetricKey

func NewRandomSymmetricKey(size int) ([]byte, error)

func NewSigner

func NewSigner(privateKey *rsa.PrivateKey) (jose.Signer, error)

NewSigner instantiate a signer using RSASSA-PSS (SHA512) with the given private key.

func Sign

func Sign(signer jose.Signer, content interface{}) (string, error)

Sign a json marshalled content and returns a protected JWS object using the full serialization format.

func UnsafeParse

func UnsafeParse(s string, i interface{}) error

func Verify

func Verify(key interface{}, s string, i interface{}) error

Verify parses the serialized, protected JWS object, than verifying the signature on the payload and unmarshal the payload into i

Types

This section is empty.

Jump to

Keyboard shortcuts

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