noop

package
v0.0.78 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package noop is a no operation encryption algorithm for use when the message is intended to be publically readable.

Noop implements the Encrypt and Decrypt interfaces to ensure that is is compatible with Mailchain protocol. It does not perform any encryption or decryption actions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decrypter

type Decrypter struct {
}

Decrypter will decrypt data using AES256CBC method

func NewDecrypter

func NewDecrypter() Decrypter

NewDecrypter create a new decrypter attaching the private key to it

func (Decrypter) Decrypt

Decrypt data using recipient private key with AES in CBC mode.

type Encrypter

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

Encrypter will not perform any operation when encrypting the message.

No operation (noop) encrypter is used when the contents of the message and envelope are intended to readable by the public.

func NewEncrypter

func NewEncrypter(pubKey crypto.PublicKey) (*Encrypter, error)

NewEncrypter create a new encrypter with crypto rand for reader

func (Encrypter) Encrypt

func (e Encrypter) Encrypt(message cipher.PlainContent) (cipher.EncryptedContent, error)

Encrypt does not apply any encrption algortim. PlainContent will be return as EncryptedContent with the encryption method prepend as the first byte.

Jump to

Keyboard shortcuts

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