Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Slatepack ¶
type Slatepack struct { // Required Fields // Versioning info Slatepack SlatepackVersion `json:"slatepack"` // Delivery Mode, 0 = plain_text, 1 = age encrypted Mode uint8 `json:"mode"` // Optional Fields // Optional Sender address Sender *SlatepackAddress `json:"sender,omitempty"` // Encrypted metadata, to be serialized into payload only // shouldn't be accessed directly // Encrypted metadata EncryptedMeta SlatepackEncMetadata `json:"encrypted_meta,omitempty"` // Payload (e.g. slate), including encrypted metadata, if present // Binary payload, can be encrypted or plaintext Payload string `json:"payload"` }
Slatepack is a basic slatepack definition
type SlatepackAddress ¶
type SlatepackAddress struct { // Human-readable prefix HRP string // ed25519 Public key, to be bech32 encoded, // interpreted as tor address or converted // to an X25519 public key for encrypting // slatepacks PubKey ed25519.PublicKey }
SlatepackAddress is the definition of a Slatepack address
func NewSlatepackAddress ¶
func NewSlatepackAddress(pubKey ed25519.PublicKey, chainType consensus.ChainType) SlatepackAddress
NewSlatepackAddress slatepack with default hrp
func NewSlatepackAddressFromString ¶
func NewSlatepackAddressFromString(encoded string) (SlatepackAddress, error)
NewSlatepackAddressFromString creates a new slatepack address from a string
func RandomSlatepackAddress ¶
func RandomSlatepackAddress(chainType consensus.ChainType) SlatepackAddress
RandomSlatepackAddress create a new slatepack address with a random key
func (SlatepackAddress) MarshalJSON ¶
func (sa SlatepackAddress) MarshalJSON() ([]byte, error)
MarshalJSON is a custom marshaler for slatepack address
func (*SlatepackAddress) UnmarshalJSON ¶
func (sa *SlatepackAddress) UnmarshalJSON(b []byte) error
UnmarshalJSON is a custom unnmarshaler for slatepack address
type SlatepackEncMetadata ¶
type SlatepackEncMetadata struct { // Encrypted Sender address, if desired Sender *SlatepackAddress `json:"sender,omitempty"` // Recipients list, if desired (mostly for future multiparty needs) Recipients []SlatepackAddress `json:"recipients,omitempty"` }
SlatepackEncMetadata encapsulates encrypted metadata fields
type SlatepackVersion ¶
type SlatepackVersion struct { // Major Major uint8 `json:"major"` // Minor Minor uint8 `json:"minor"` }
SlatepackVersion slatepack versionn
func (SlatepackVersion) MarshalJSON ¶
func (v SlatepackVersion) MarshalJSON() ([]byte, error)
MarshalJSON marshals the VersionCompatInfoV4 as a quoted version like {}:{}
func (*SlatepackVersion) UnmarshalJSON ¶
func (v *SlatepackVersion) UnmarshalJSON(bs []byte) error
UnmarshalJSON unmarshals a quoted version to a VersionCompatInfoV4