httpece

package module
v0.0.0-...-6bf8b8a Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: MIT Imports: 12 Imported by: 0

README

http-ece

GoDoc Go Report Card MIT License

a simple implementation of encrypted-content-encoding for Go.

Requirements

Go 1.20 and beyond.

Install

go get -u github.com/crow-misia/http-ece

Build

go install golang.org/x/tools/cmd/stringer
go generate
go build

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(content []byte, opts ...Option) ([]byte, error)

Decrypt decrypts content data.

func Encrypt

func Encrypt(plaintext []byte, opts ...Option) ([]byte, error)

Encrypt encrypts plaintext data.

Types

type ContentEncoding

type ContentEncoding int

ContentEncoding is crypto data encoding

const (
	AES128GCM ContentEncoding
	AESGCM
)

func (ContentEncoding) Padding

func (i ContentEncoding) Padding() int

Padding returns crypto data padding size.

func (ContentEncoding) String

func (i ContentEncoding) String() string

type Option

type Option func(*options)

func WithAuthSecret

func WithAuthSecret(v []byte) Option

func WithDh

func WithDh(v []byte) Option

func WithEncoding

func WithEncoding(v ContentEncoding) Option

func WithKeyLabel

func WithKeyLabel(v []byte) Option

func WithKeyMap

func WithKeyMap(v func([]byte) []byte) Option

func WithPrivate

func WithPrivate(v []byte) Option

func WithRecordSize

func WithRecordSize(v uint32) Option

func WithSalt

func WithSalt(v []byte) Option

Jump to

Keyboard shortcuts

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