sbox

package
v0.0.0-...-21d4feb Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package sbox is a generated protocol buffer package.

It is generated from these files:

box.proto

It has these top-level messages:

Key
Box
Payload

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthBox = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowBox   = fmt.Errorf("proto: integer overflow")
)

Functions

func GenerateKey

func GenerateKey() (string, error)

GenerateKey for box

func Open

func Open(data []byte, receiverKey, masterKey string) ([]byte, error)

Open secure box

func PublicKey

func PublicKey(privateKey string) (string, error)

func Seal

func Seal(data []byte, masterKey string, receiverKeys []string) ([]byte, error)

Seal a container

Types

type Box

type Box struct {
	Keys    []*Key   `protobuf:"bytes,1,rep,name=keys" json:"keys,omitempty"`
	Payload *Payload `protobuf:"bytes,2,opt,name=payload" json:"payload,omitempty"`
}

func (*Box) Descriptor

func (*Box) Descriptor() ([]byte, []int)

func (*Box) GetKeys

func (m *Box) GetKeys() []*Key

func (*Box) GetPayload

func (m *Box) GetPayload() *Payload

func (*Box) Marshal

func (m *Box) Marshal() (dAtA []byte, err error)

func (*Box) MarshalTo

func (m *Box) MarshalTo(dAtA []byte) (int, error)

func (*Box) ProtoMessage

func (*Box) ProtoMessage()

func (*Box) Reset

func (m *Box) Reset()

func (*Box) Size

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

func (*Box) String

func (m *Box) String() string

func (*Box) Unmarshal

func (m *Box) Unmarshal(dAtA []byte) error

type Key

type Key struct {
	PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	Nonce     []byte `protobuf:"bytes,2,opt,name=nonce,proto3" json:"nonce,omitempty"`
	BoxKey    []byte `protobuf:"bytes,3,opt,name=box_key,json=boxKey,proto3" json:"box_key,omitempty"`
}

func (*Key) Descriptor

func (*Key) Descriptor() ([]byte, []int)

func (*Key) Marshal

func (m *Key) Marshal() (dAtA []byte, err error)

func (*Key) MarshalTo

func (m *Key) MarshalTo(dAtA []byte) (int, error)

func (*Key) ProtoMessage

func (*Key) ProtoMessage()

func (*Key) Reset

func (m *Key) Reset()

func (*Key) Size

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

func (*Key) String

func (m *Key) String() string

func (*Key) Unmarshal

func (m *Key) Unmarshal(dAtA []byte) error

type Payload

type Payload struct {
	Nonce []byte `protobuf:"bytes,1,opt,name=nonce,proto3" json:"nonce,omitempty"`
	Data  []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
}

func (*Payload) Descriptor

func (*Payload) Descriptor() ([]byte, []int)

func (*Payload) Marshal

func (m *Payload) Marshal() (dAtA []byte, err error)

func (*Payload) MarshalTo

func (m *Payload) MarshalTo(dAtA []byte) (int, error)

func (*Payload) ProtoMessage

func (*Payload) ProtoMessage()

func (*Payload) Reset

func (m *Payload) Reset()

func (*Payload) Size

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

func (*Payload) String

func (m *Payload) String() string

func (*Payload) Unmarshal

func (m *Payload) Unmarshal(dAtA []byte) error

Jump to

Keyboard shortcuts

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