jose

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: MIT Imports: 5 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 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 Stamper

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

Stamper is the interface that handles commonly used JOSE operations.

type Standard

type Standard struct {
	// contains filtered or unexported fields
}

Standard implements Stamper interface.

func New

func New(publicKey, privateKey string) (*Standard, error)

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

func (*Standard) Decode

func (s *Standard) Decode(data string) ([]byte, error)

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

func (*Standard) Decrypt

func (s *Standard) Decrypt(data string) ([]byte, error)

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

func (*Standard) Encode

func (s *Standard) Encode(payload []byte) (string, error)

Encode signs a payload and produces a signed JWS object.

func (*Standard) Encrypt

func (s *Standard) Encrypt(payload []byte) (string, error)

Encrypt encrypts a payload and produces an encrypted JWE object.

Jump to

Keyboard shortcuts

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