envelop

package
v0.0.0-...-8654c45 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2014 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enveloper

type Enveloper struct {
	EncryptedKey []byte
	Signature    []byte
	Metadata     *Metadata
	// contains filtered or unexported fields
}

func NewEnveloper

func NewEnveloper(publicKeyEncryptor PublicKeyEncryptor, payload Payload, signer Signer) *Enveloper

func (*Enveloper) CreateEnvelopCompletely

func (this *Enveloper) CreateEnvelopCompletely() error

func (*Enveloper) CreateMetadata

func (this *Enveloper) CreateMetadata() *Metadata

func (*Enveloper) EncryptKey

func (this *Enveloper) EncryptKey() ([]byte, error)

func (*Enveloper) SignPayload

func (this *Enveloper) SignPayload() ([]byte, error)

func (*Enveloper) WriteEncryptedKey

func (this *Enveloper) WriteEncryptedKey(z *zip.Writer) error

func (*Enveloper) WriteMetadata

func (this *Enveloper) WriteMetadata(z *zip.Writer) error

func (*Enveloper) WritePayload

func (this *Enveloper) WritePayload(z *zip.Writer) error

func (*Enveloper) WriteToWriter

func (this *Enveloper) WriteToWriter(w io.Writer) error

type Metadata

type Metadata struct {
	BlockMode          string
	BlockAlgorithm     string
	SignatureAlgorithm string
	HashMethod         string
}

type Payload

type Payload interface {
	GetHash() []byte
	GetKey() []byte
	GetAlgorithm() string
	GetMode() string
	GetHashMethod() string
	GetPayloadData() (io.Reader, error)
}

type PublicKeyEncryptor

type PublicKeyEncryptor interface {
	Encrypt(data []byte) ([]byte, error)
}

type Signer

type Signer interface {
	Sign(data []byte) ([]byte, error)
}

Jump to

Keyboard shortcuts

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