cryptutil

package
v0.0.0-...-acaa9d6 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2017 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Formatting function: take the 16 random bytes and return them as a string
	// of 8-4-4-4-12 tuples, separated by dashes
	DashedUUID = func(b []byte) string {
		return fmt.Sprintf("%x-%x-%x-%x-%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:])
	}

	// An alternative formatting function: take the 16 random bytes and return
	// them as a single string, with no dashes
	UndashedUUID = func(b []byte) string {
		return fmt.Sprintf("%x", b)
	}
)

Functions

func AsEntity

func AsEntity(key string) (*openpgp.Entity, error)

Convert the armored key into an OpenPGP Entity

func DecodeArmoredKey

func DecodeArmoredKey(key string) (*armor.Block, error)

Attempt to convert the given string into an armored Block, returning an error if the string is not valid armor

func EncryptData

func EncryptData(keys []*database.PUBLIC_KEY, data string) (string, error)

Encrypt the data with the list of PGP keys, returning an armored string

func GenerateUUID

func GenerateUUID(fn func([]byte) string) string

Generate a universally unique identifier (UUID) using the computer's /dev/urandom output as a randomizer, returning a string specified by the given formatting function

Types

This section is empty.

Jump to

Keyboard shortcuts

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