cse

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package cse provides simple client-side encryption helpers.

Index

Constants

View Source
const (
	// MetadataKeyAlgorithm stores the CSE algorithm in user metadata.
	MetadataKeyAlgorithm = "rustfs-cse-algorithm"
	// MetadataKeyNonce stores the base64-encoded nonce in user metadata.
	MetadataKeyNonce = "rustfs-cse-nonce"
	// AlgorithmAESGCM indicates AES-GCM encryption.
	AlgorithmAESGCM = "AES-GCM"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client provides client-side encryption helpers.

func New

func New(key []byte) (*Client, error)

New creates a new CSE client with a 16, 24, or 32 byte key.

func (*Client) Decrypt

func (c *Client) Decrypt(reader io.Reader, metadata map[string]string) ([]byte, error)

Decrypt decrypts the entire reader using metadata.

func (*Client) Encrypt

func (c *Client) Encrypt(reader io.Reader) ([]byte, map[string]string, error)

Encrypt encrypts the entire reader and returns ciphertext and metadata.

Jump to

Keyboard shortcuts

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