seal

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package seal is a generated protocol buffer package.

It is generated from these files:

seal/seal.proto
seal/openpgp.proto

It has these top-level messages:

Envelope

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthOpenpgp = fmt.Errorf("proto: negative length found during unmarshaling")
)
View Source
var (
	ErrInvalidLengthSeal = fmt.Errorf("proto: negative length found during unmarshaling")
)

Functions

func Marshal

func Marshal(s Seal) ([]byte, error)

Marshal returns the proto3 encoding of s.

Types

type Envelope

type Envelope struct {
	Openpgp *OpenPGP `protobuf:"bytes,1,opt,name=openpgp" json:"openpgp,omitempty"`
}

func Wrap

func Wrap(s Seal) (*Envelope, error)

Wrap returns an intermediate form of the Seal for marshalling.

func (*Envelope) GetOpenpgp

func (m *Envelope) GetOpenpgp() *OpenPGP

func (*Envelope) GetValue

func (this *Envelope) GetValue() interface{}

func (*Envelope) Marshal

func (m *Envelope) Marshal() (data []byte, err error)

func (*Envelope) MarshalTo

func (m *Envelope) MarshalTo(data []byte) (int, error)

func (*Envelope) ProtoMessage

func (*Envelope) ProtoMessage()

func (*Envelope) Reset

func (m *Envelope) Reset()

func (*Envelope) Seal

func (e *Envelope) Seal() (Seal, error)

Seal returns the concrete type from the intermediate form.

func (*Envelope) SetValue

func (this *Envelope) SetValue(value interface{}) bool

func (*Envelope) Size

func (m *Envelope) Size() (n int)

func (*Envelope) String

func (m *Envelope) String() string

func (*Envelope) Unmarshal

func (m *Envelope) Unmarshal(data []byte) error

type OpenPGP

type OpenPGP struct {
	Nonce     []byte `protobuf:"bytes,1,opt,name=nonce,proto3" json:"nonce,omitempty"`
	Entity    []byte `protobuf:"bytes,2,opt,name=entity,proto3" json:"entity,omitempty"`
	Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"`
}

func NewOpenPGP

func NewOpenPGP(signer *openpgp.Entity, data []byte) (*OpenPGP, error)

NewOpenPGP constructs an OpenPGP seal from an OpenPGP entity and signing data. The entity must contain a signing private key.

func (*OpenPGP) Check

func (s *OpenPGP) Check(data []byte) error

Check verifies the OpenPGP signature for the data using the signing public key in the entity.

func (*OpenPGP) Digest

func (s *OpenPGP) Digest() ([]byte, error)

Digest returns an HMAC of the entity and signature data.

func (*OpenPGP) Marshal

func (m *OpenPGP) Marshal() (data []byte, err error)

func (*OpenPGP) MarshalTo

func (m *OpenPGP) MarshalTo(data []byte) (int, error)

func (*OpenPGP) ProtoMessage

func (*OpenPGP) ProtoMessage()

func (*OpenPGP) Reset

func (m *OpenPGP) Reset()

func (*OpenPGP) Size

func (m *OpenPGP) Size() (n int)

func (*OpenPGP) String

func (m *OpenPGP) String() string

func (*OpenPGP) Unmarshal

func (m *OpenPGP) Unmarshal(data []byte) error

type Seal

type Seal interface {
	// Check verifies the seal for the data.
	Check(data []byte) error

	// Digest returns a unique series of bytes that identify the Seal.
	Digest() ([]byte, error)

	// Marshal returns the binary representation of the Seal.
	Marshal() (data []byte, err error)

	// Unmarshal parses the Seal encoded in data.
	Unmarshal(data []byte) error
}

Seal holds a verifiable signature.

func Unmarshal

func Unmarshal(data []byte) (Seal, error)

Unmarshal parses the proto3 encoded seal.

Jump to

Keyboard shortcuts

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