record_pb

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthEnvelope        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEnvelope          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupEnvelope = fmt.Errorf("proto: unexpected end of group")
)

Functions

This section is empty.

Types

type Envelope

type Envelope struct {
	// public_key is the public key of the keypair the enclosed payload was
	// signed with.
	PublicKey *pb.PublicKey `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	// payload_type encodes the type of payload, so that it can be deserialized
	// deterministically.
	PayloadType []byte `protobuf:"bytes,2,opt,name=payload_type,json=payloadType,proto3" json:"payload_type,omitempty"`
	// payload is the actual payload carried inside this envelope.
	Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
	// signature is the signature produced by the private key corresponding to
	// the enclosed public key, over the payload, prefixing a domain string for
	// additional security.
	Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"`
}

Envelope encloses a signed payload produced by a peer, along with the public key of the keypair it was signed with so that it can be statelessly validated by the receiver.

The payload is prefixed with a byte string that determines the type, so it can be deserialized deterministically. Often, this byte string is a multicodec.

func (*Envelope) Descriptor

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

func (*Envelope) GetPayload

func (m *Envelope) GetPayload() []byte

func (*Envelope) GetPayloadType

func (m *Envelope) GetPayloadType() []byte

func (*Envelope) GetPublicKey

func (m *Envelope) GetPublicKey() *pb.PublicKey

func (*Envelope) GetSignature

func (m *Envelope) GetSignature() []byte

func (*Envelope) Marshal

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

func (*Envelope) MarshalTo

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

func (*Envelope) MarshalToSizedBuffer

func (m *Envelope) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Envelope) ProtoMessage

func (*Envelope) ProtoMessage()

func (*Envelope) Reset

func (m *Envelope) Reset()

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

func (*Envelope) XXX_DiscardUnknown

func (m *Envelope) XXX_DiscardUnknown()

func (*Envelope) XXX_Marshal

func (m *Envelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Envelope) XXX_Merge

func (m *Envelope) XXX_Merge(src proto.Message)

func (*Envelope) XXX_Size

func (m *Envelope) XXX_Size() int

func (*Envelope) XXX_Unmarshal

func (m *Envelope) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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