Documentation ¶
Index ¶
- Constants
- func CreateSharedKey(own KeySet, other PublicKeySet) ([sha256.Size]byte, error)
- func Decrypt(sharedKey []byte, initialVector InitialVector, message []byte) ([]byte, error)
- type Client
- type CommandQueue
- type Config
- type Connection
- type EphemeralUser
- type InitialVector
- type KeySet
- type PublicKeySet
Constants ¶
View Source
const MaxNumberOfCommands int = 16
Variables ¶
This section is empty.
Functions ¶
func CreateSharedKey ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(user EphemeralUser, conn *Connection) Client
func (*Client) BroadcastKeys ¶
func (*Client) RefreshKeys ¶
func (*Client) SendMessage ¶
type CommandQueue ¶
type CommandQueue struct {
// contains filtered or unexported fields
}
func CreateCommandQueue ¶
func CreateCommandQueue() CommandQueue
func (*CommandQueue) Enqueue ¶
func (queue *CommandQueue) Enqueue(out commands.IOut)
func (*CommandQueue) Free ¶
func (queue *CommandQueue) Free(slot int)
func (*CommandQueue) TakeSlot ¶
func (queue *CommandQueue) TakeSlot() (int, error)
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func Connect ¶
func Connect(address string) (*Connection, error)
func (*Connection) Close ¶
func (cnn *Connection) Close()
func (*Connection) FreeCommandSlot ¶
func (cnn *Connection) FreeCommandSlot(slot int)
func (*Connection) IsOpen ¶
func (cnn *Connection) IsOpen() bool
func (*Connection) SendNext ¶
func (cnn *Connection) SendNext() error
type InitialVector ¶
type InitialVector = [ivSize]byte
type KeySet ¶
type KeySet struct { PrivateKey ed25519.PrivateKey //Private component of identity key PublicKey ed25519.PublicKey // public component of identity key PreKey *ecdh.PrivateKey // This pre signed key is a temporary identity key Ek *ecdh.PrivateKey // this ephemeral key should be created for each exchange Signature []byte // signature, used to authenticate the preKey. }
func CreateKeys ¶
func CreateKeys() KeySet
Click to show internal directories.
Click to hide internal directories.