jose

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package jose provides an implementation of the Javascript Object Signing and Encryption.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode added in v1.6.0

func Decode(pub *rsa.PublicKey, data string) ([]byte, error)

Decode parses a signed message in compact or full serialization format.

func Decrypt added in v1.6.0

func Decrypt(prv *rsa.PrivateKey, data string) ([]byte, error)

Decrypt parses an encrypted message in compact or full serialization format.

func RSAPrivateKey

func RSAPrivateKey(data []byte) (*rsa.PrivateKey, error)

RSAPrivateKey parses data as *rsa.PrivateKey

func RSAPublicKey

func RSAPublicKey(data []byte) (*rsa.PublicKey, error)

RSAPublicKey parses data as *rsa.PublicKey

Types

type Encryption added in v1.6.0

type Encryption interface {
	Encrypt(payload []byte) (string, error)
	Decrypt(data string) ([]byte, error)
}

Encryption is the interface that handles commonly used JWE operations.

func NewEncryption added in v1.6.0

func NewEncryption(publicKey, privateKey string) (Encryption, error)

New returns a Encryption. It's using predefined key, compression and algorithm.

type Signature added in v1.6.0

type Signature interface {
	Encode(payload []byte) (string, error)
	Decode(data string) ([]byte, error)
}

Signature is the interface that handles commonly used JWS operations.

func NewSignature added in v1.6.0

func NewSignature(publicKey, privateKey string) (Signature, error)

NewSignature returns a Signature. It's using predefined key and algorithm.

type Stamper

type Stamper interface {
	Signature
	Encryption
}

Stamper is the interface that handles commonly used JOSE operations.

func New

func New(publicKey, privateKey string) (Stamper, error)

New returns a Stamper. It's using predefined key, compression and algorithm.

Jump to

Keyboard shortcuts

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