dcrypt

package
v0.0.0-...-89c5f36 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2014 License: ISC Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEncryptedRecipients

func NewEncryptedRecipients(from *mcrypt.Identity,
	to []mcrypt.PublicIdentity,
	payload []byte) ([]byte, error)

Types

type AnonHeader

type AnonHeader struct {
	Nonce []byte // nonce to decrypt recipients
}

Public Key is known to recipients

type Header struct {
	PublicIdentity mcrypt.PublicIdentity
	Nonce          []byte // nonce to decrypt recipients
	Signature      []byte // signature of nonce
}

type Payload

type Payload struct {
	Basename    string
	Description string
	Compression string
	Mime        string
	Payload     []byte
}

func NewPayload

func NewPayload(filename, description string, compress bool) (*Payload, error)

func NewPayloadFromJson

func NewPayloadFromJson(j []byte, decompress bool) (*Payload, error)

func (*Payload) Marshal

func (p *Payload) Marshal() ([]byte, error)

type Recipients

type Recipients struct {
	PublicIdentities []mcrypt.Message
}

type SharedSecret

type SharedSecret struct {
	Identity mcrypt.Identity
}

SharedSecret is what is used to encrypt Payload. All recipients will be able to decrypt this.

func NewSharedSecret

func NewSharedSecret(name, address string) (*SharedSecret, error)

Generate a shared secret identity to encrypt Payload.

func SharedSecretFromRecipient

func SharedSecretFromRecipient(me *mcrypt.Identity,
	them *mcrypt.PublicIdentity,
	payload []byte) (*SharedSecret, error)

func (*SharedSecret) Decrypt

func (s *SharedSecret) Decrypt(m *mcrypt.Message) ([]byte, error)

func (*SharedSecret) Encrypt

func (s *SharedSecret) Encrypt(payload []byte) (*mcrypt.Message, error)

Jump to

Keyboard shortcuts

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