encryptedbox

package
v0.0.0-...-7a31eba Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Simple wrapper + JSON struct for encrypting/decrypting short values inside pkencryptedstream

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Box

type Box struct {
	KeyFingerprint string `json:"key_fingerprint"` // .. of the encryption key that encrypted this box
	Ciphertext     []byte `json:"ciphertext"`      // gokit/pkencryptedstream
}

func Encrypt

func Encrypt(plaintext []byte, pubKey *rsa.PublicKey) (*Box, error)

func New

func New(keyFingerprint string, ciphertext []byte) *Box

func (*Box) Decrypt

func (e *Box) Decrypt(privKey *rsa.PrivateKey, fingerprint string) ([]byte, error)

func (*Box) DecryptNoFingerprint

func (e *Box) DecryptNoFingerprint(privKey *rsa.PrivateKey) ([]byte, error)

Jump to

Keyboard shortcuts

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