Documentation ¶
Overview ¶
Package cryptex is a generated protocol buffer package.
It is generated from these files:
cryptex/cryptex.proto cryptex/sss.proto cryptex/xor.proto cryptex/secretbox.proto cryptex/box.proto cryptex/rsa.proto cryptex/openpgp.proto cryptex/mux.proto cryptex/demux.proto
It has these top-level messages:
Envelope
Index ¶
- Variables
- func Marshal(cptx Cryptex) ([]byte, error)
- type Box
- func (c *Box) Close(inputs, secrets [][]byte) error
- func (c *Box) Comment() string
- func (m *Box) Marshal() (data []byte, err error)
- func (m *Box) MarshalTo(data []byte) (int, error)
- func (c *Box) Open(secrets, inputs [][]byte) error
- func (*Box) ProtoMessage()
- func (m *Box) Reset()
- func (m *Box) Size() (n int)
- func (m *Box) String() string
- func (m *Box) Unmarshal(data []byte) error
- type ByteStream
- type Cryptex
- type Demux
- func (c *Demux) Close(inputs, secrets [][]byte) error
- func (c *Demux) Comment() string
- func (m *Demux) Marshal() (data []byte, err error)
- func (m *Demux) MarshalTo(data []byte) (int, error)
- func (c *Demux) Open(secrets, inputs [][]byte) error
- func (*Demux) ProtoMessage()
- func (m *Demux) Reset()
- func (m *Demux) Size() (n int)
- func (m *Demux) String() string
- func (m *Demux) Unmarshal(data []byte) error
- type Envelope
- func (e *Envelope) Cryptex() (Cryptex, error)
- func (m *Envelope) GetBox() *Box
- func (m *Envelope) GetDemux() *Demux
- func (m *Envelope) GetMux() *Mux
- func (m *Envelope) GetOpenPGP() *OpenPGP
- func (m *Envelope) GetRSA() *RSA
- func (m *Envelope) GetSSS() *SSS
- func (m *Envelope) GetSecretBox() *SecretBox
- func (this *Envelope) GetValue() interface{}
- func (m *Envelope) GetXOR() *XOR
- func (m *Envelope) Marshal() (data []byte, err error)
- func (m *Envelope) MarshalTo(data []byte) (int, error)
- func (*Envelope) ProtoMessage()
- func (m *Envelope) Reset()
- func (this *Envelope) SetValue(value interface{}) bool
- func (m *Envelope) Size() (n int)
- func (m *Envelope) String() string
- func (m *Envelope) Unmarshal(data []byte) error
- type Mux
- func (c *Mux) Close(inputs, secrets [][]byte) error
- func (c *Mux) Comment() string
- func (m *Mux) Marshal() (data []byte, err error)
- func (m *Mux) MarshalTo(data []byte) (int, error)
- func (c *Mux) Open(secrets, inputs [][]byte) error
- func (*Mux) ProtoMessage()
- func (m *Mux) Reset()
- func (m *Mux) Size() (n int)
- func (m *Mux) String() string
- func (m *Mux) Unmarshal(data []byte) error
- type OpenPGP
- func (c *OpenPGP) Close(inputs, secrets [][]byte) error
- func (c *OpenPGP) Comment() string
- func (m *OpenPGP) Marshal() (data []byte, err error)
- func (m *OpenPGP) MarshalTo(data []byte) (int, error)
- func (c *OpenPGP) Open(secrets, inputs [][]byte) error
- func (*OpenPGP) ProtoMessage()
- func (m *OpenPGP) Reset()
- func (m *OpenPGP) Size() (n int)
- func (m *OpenPGP) String() string
- func (m *OpenPGP) Unmarshal(data []byte) error
- type RSA
- func (c *RSA) Close(inputs, secrets [][]byte) error
- func (c *RSA) Comment() string
- func (m *RSA) Marshal() (data []byte, err error)
- func (m *RSA) MarshalTo(data []byte) (int, error)
- func (c *RSA) Open(secrets, inputs [][]byte) error
- func (*RSA) ProtoMessage()
- func (m *RSA) Reset()
- func (m *RSA) Size() (n int)
- func (m *RSA) String() string
- func (m *RSA) Unmarshal(data []byte) error
- type SSS
- func (c *SSS) Close(inputs, secrets [][]byte) error
- func (c *SSS) Comment() string
- func (m *SSS) Marshal() (data []byte, err error)
- func (m *SSS) MarshalTo(data []byte) (int, error)
- func (c *SSS) Open(secrets, inputs [][]byte) error
- func (*SSS) ProtoMessage()
- func (m *SSS) Reset()
- func (m *SSS) Size() (n int)
- func (m *SSS) String() string
- func (m *SSS) Unmarshal(data []byte) error
- type SecretBox
- func (c *SecretBox) Close(inputs, secrets [][]byte) error
- func (c *SecretBox) Comment() string
- func (m *SecretBox) Marshal() (data []byte, err error)
- func (m *SecretBox) MarshalTo(data []byte) (int, error)
- func (c *SecretBox) Open(secrets, inputs [][]byte) error
- func (*SecretBox) ProtoMessage()
- func (m *SecretBox) Reset()
- func (m *SecretBox) Size() (n int)
- func (m *SecretBox) String() string
- func (m *SecretBox) Unmarshal(data []byte) error
- type XOR
- func (c *XOR) Close(inputs, secrets [][]byte) error
- func (c *XOR) Comment() string
- func (m *XOR) Marshal() (data []byte, err error)
- func (m *XOR) MarshalTo(data []byte) (int, error)
- func (c *XOR) Open(secrets, inputs [][]byte) error
- func (*XOR) ProtoMessage()
- func (m *XOR) Reset()
- func (m *XOR) Size() (n int)
- func (m *XOR) String() string
- func (m *XOR) Unmarshal(data []byte) error
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidLengthBox = fmt.Errorf("proto: negative length found during unmarshaling")
)
var (
ErrInvalidLengthCryptex = fmt.Errorf("proto: negative length found during unmarshaling")
)
var (
ErrInvalidLengthDemux = fmt.Errorf("proto: negative length found during unmarshaling")
)
var (
ErrInvalidLengthMux = fmt.Errorf("proto: negative length found during unmarshaling")
)
var (
ErrInvalidLengthOpenpgp = fmt.Errorf("proto: negative length found during unmarshaling")
)
var (
ErrInvalidLengthRsa = fmt.Errorf("proto: negative length found during unmarshaling")
)
var (
ErrInvalidLengthSecretbox = fmt.Errorf("proto: negative length found during unmarshaling")
)
var (
ErrInvalidLengthSss = fmt.Errorf("proto: negative length found during unmarshaling")
)
var (
ErrInvalidLengthXor = fmt.Errorf("proto: negative length found during unmarshaling")
)
Functions ¶
Types ¶
type Box ¶
type Box struct { PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,proto3" json:"public_key,omitempty"` // contains filtered or unexported fields }
func (*Box) Close ¶
Close seals the secret using PublicKey. The ciphertext is stored in the input data.
func (*Box) Open ¶
Open unseals a secret from the ciphertext & private key portions of the input data.
func (*Box) ProtoMessage ¶
func (*Box) ProtoMessage()
type ByteStream ¶
type ByteStream struct {
Chunks [][]byte `protobuf:"bytes,1,rep,name=chunks" json:"chunks,omitempty"`
}
func (*ByteStream) Marshal ¶
func (m *ByteStream) Marshal() (data []byte, err error)
func (*ByteStream) ProtoMessage ¶
func (*ByteStream) ProtoMessage()
func (*ByteStream) Reset ¶
func (m *ByteStream) Reset()
func (*ByteStream) Size ¶
func (m *ByteStream) Size() (n int)
func (*ByteStream) String ¶
func (m *ByteStream) String() string
func (*ByteStream) Unmarshal ¶
func (m *ByteStream) Unmarshal(data []byte) error
type Cryptex ¶
type Cryptex interface { // Optional description of the cryptex usage. Comment() string // Close encloses the inputs into the secret. Close(inputs, secrets [][]byte) error // Open unwraps the secrets contained in the inputs. Open(secrets, inputs [][]byte) error // Marshal returns the binary representation of the Cryptex. Marshal() (data []byte, err error) // Unmarshal parses the Cryptex encoded in data. Unmarshal(data []byte) error }
Cryptex lock intermediate secrets.
type Demux ¶
type Demux struct { Seed []byte `protobuf:"bytes,2,opt,name=seed,proto3" json:"seed,omitempty"` // contains filtered or unexported fields }
func NewDemux ¶
NewDemux constructs a new Demux cryptex. The HKDF cryptographic key derivation function is combined with XOR pads to map a multiple secrets to a single input.
func (*Demux) ProtoMessage ¶
func (*Demux) ProtoMessage()
type Envelope ¶
type Envelope struct { SSS *SSS `protobuf:"bytes,1,opt,name=sss" json:"sss,omitempty"` XOR *XOR `protobuf:"bytes,2,opt,name=xor" json:"xor,omitempty"` SecretBox *SecretBox `protobuf:"bytes,3,opt,name=secretbox" json:"secretbox,omitempty"` Box *Box `protobuf:"bytes,4,opt,name=box" json:"box,omitempty"` RSA *RSA `protobuf:"bytes,5,opt,name=rsa" json:"rsa,omitempty"` OpenPGP *OpenPGP `protobuf:"bytes,6,opt,name=openpgp" json:"openpgp,omitempty"` Mux *Mux `protobuf:"bytes,7,opt,name=mux" json:"mux,omitempty"` Demux *Demux `protobuf:"bytes,8,opt,name=demux" json:"demux,omitempty"` }
func (*Envelope) GetOpenPGP ¶
func (*Envelope) GetSecretBox ¶
func (*Envelope) ProtoMessage ¶
func (*Envelope) ProtoMessage()
type Mux ¶
type Mux struct { Seed []byte `protobuf:"bytes,2,opt,name=seed,proto3" json:"seed,omitempty"` // contains filtered or unexported fields }
func NewMux ¶
NewMux constructs a new Mux cryptex. The HKDF cryptographic key derivation function is used to stretch the secret into multiple inputs.
func (*Mux) Close ¶
Close seals a single secret to two or more inputs. Each input is unique and any single input may recover the secret.
func (*Mux) ProtoMessage ¶
func (*Mux) ProtoMessage()
type OpenPGP ¶
type OpenPGP struct { Entities [][]byte `protobuf:"bytes,2,rep,name=entities" json:"entities,omitempty"` // contains filtered or unexported fields }
func NewOpenPGP ¶
NewOpenPGP constructs a new OpenPGP for one or more entities containing a public key for encryption.
func (*OpenPGP) Close ¶
Close seals a single secret by encrypting with the public keys from the entities.
func (*OpenPGP) Open ¶
Open unseals a single secret with a private key input matching a public key from the entities.
func (*OpenPGP) ProtoMessage ¶
func (*OpenPGP) ProtoMessage()
type RSA ¶
type RSA struct { PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,proto3" json:"public_key,omitempty"` // contains filtered or unexported fields }
func (*RSA) Close ¶
Close seals the secret using OAEP encryption with the PublicKey. The ciphertext is stored in the input data.
func (*RSA) Open ¶
Open unseals a secret using OAEP decryption from the ciphertext & RSA private key portions of the input data.
func (*RSA) ProtoMessage ¶
func (*RSA) ProtoMessage()
type SSS ¶
type SSS struct { N uint32 `protobuf:"varint,2,opt,name=n,proto3" json:"n,omitempty"` K uint32 `protobuf:"varint,3,opt,name=k,proto3" json:"k,omitempty"` // contains filtered or unexported fields }
func NewSSS ¶
NewSSS constructs a new SSS for N shares of which K are required to recover the secrets.
func (*SSS) ProtoMessage ¶
func (*SSS) ProtoMessage()
type SecretBox ¶
type SecretBox struct {
// contains filtered or unexported fields
}
func NewSecretBox ¶
NewSecretBox constructs a new SecretBox for a single input.
func (*SecretBox) Close ¶
Close seals the secret to the input key. The input key is generated if not present in the inputs data.
func (*SecretBox) ProtoMessage ¶
func (*SecretBox) ProtoMessage()