blobcrypto

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package blobcrypto performs whole-blob crypto operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(c Crypter, payload gather.Bytes, blobID blob.ID, output *gather.WriteBuffer) error

Decrypt decrypts the provided data using provided blobID to derive initialization vector.

func Encrypt

func Encrypt(c Crypter, payload gather.Bytes, prefix, suffix blob.ID, output *gather.WriteBuffer) (blob.ID, error)

Encrypt encrypts the given data using crypter-defined key and returns a name that should be used to save the blob in the repository.

Types

type Crypter

type Crypter interface {
	HashFunc() hashing.HashFunc
	Encryptor() encryption.Encryptor
}

Crypter ecapsulates hashing and encryption.

type StaticCrypter added in v0.16.0

type StaticCrypter struct {
	Hash       hashing.HashFunc
	Encryption encryption.Encryptor
}

StaticCrypter implements Crypter interface with static hash and encryption functions.

func (StaticCrypter) Encryptor added in v0.16.0

func (p StaticCrypter) Encryptor() encryption.Encryptor

Encryptor returns the encryption algorithm.

func (StaticCrypter) HashFunc added in v0.16.0

func (p StaticCrypter) HashFunc() hashing.HashFunc

HashFunc returns the hashing algorithm.

Jump to

Keyboard shortcuts

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