pki

package
v0.0.0-...-96bc9f9 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client default implementation of a messaging client

func New

func New(config Config) (*Client, error)

New create a new messaging client

func (*Client) GetDeviceKey

func (c *Client) GetDeviceKey(selfID, deviceID string) ([]byte, error)

GetDeviceKey gets an identities one time device key

func (*Client) GetHistory

func (c *Client) GetHistory(selfID string) ([]json.RawMessage, error)

GetHistory gets an identities public keys

func (*Client) SetDeviceKeys

func (c *Client) SetDeviceKeys(selfID, deviceID string, pkb []byte) error

SetDeviceKeys updates an identites device prekey bundle

type Config

type Config struct {
	SelfID     string
	PrivateKey ed25519.PrivateKey
	APIURL     string
	Transport  Transport
}

Config messaging configuration for connecting to self messaging

type Transport

type Transport interface {
	Get(path string) ([]byte, error)
	Post(path, contentType string, payload []byte) ([]byte, error)
}

Transport the stateful connection used to send and receive messages

Jump to

Keyboard shortcuts

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