jwe

package
v2.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package jwe encrypts/decrypts Agent messages to/from JSON Web Encryption compact serialization format

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encrypter

type Encrypter struct {
}

func NewEncrypter

func NewEncrypter() *Encrypter

NewEncrypter is a factory to return a structure that implements the Transformer interface

func (*Encrypter) Construct

func (e *Encrypter) Construct(data any, key []byte) ([]byte, error)

Construct takes data in data, encrypts it using PBES2 (RFC 2898) with HMAC SHA-512 as the PRF and AES Key Wrap (RFC 3394) using 256-bit keys for the encryption scheme. The data is then transformed into a JSON Web Encryption (JWE) object and serializes it using the compact serialization format to string that is returned as bytes. PBES2 uses Password-Based Key Derivation Function 2 (PBKDF2) with a hard-coded 3000 rounds (iterations)

func (*Encrypter) Deconstruct

func (e *Encrypter) Deconstruct(data, key []byte) (any, error)

Deconstruct takes in a JSON Web Encryption (JWE) object in the compact serialization format as bytes, decrypts it, and returns it that data as bytes

func (*Encrypter) String

func (e *Encrypter) String() string

String returns a string representation of the encrypter type

Jump to

Keyboard shortcuts

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