package session
import "go.mau.fi/libsignal/keys/session"
Package session provides a simple structure for session keys, which is a pair of root and chain keys for a session.
Index ¶
- type ChainKeyable
- type DerivedSecrets
- func NewDerivedSecrets(keyMaterial []byte) *DerivedSecrets
- func (d *DerivedSecrets) ChainKey() []byte
- func (d *DerivedSecrets) RootKey() []byte
- type KeyPair
- type RootKeyable
Types ¶
type ChainKeyable ¶
type ChainKeyable interface { Key() []byte Index() uint32 NextKey() *chain.Key MessageKeys() *message.Keys Current() *chain.Key }
ChainKeyable is an interface for all chain key implementations that are part of a session keypair.
type DerivedSecrets ¶
type DerivedSecrets struct {
// contains filtered or unexported fields
}
DerivedSecrets is a structure for holding the derived secrets for the Root and Chain keys for a session.
func NewDerivedSecrets ¶
func NewDerivedSecrets(keyMaterial []byte) *DerivedSecrets
NewDerivedSecrets returns a new RootKey/ChainKey pair from 64 bytes of key material generated by the key derivation function.
func (*DerivedSecrets) ChainKey ¶
func (d *DerivedSecrets) ChainKey() []byte
ChainKey returns the ChainKey bytes.
func (*DerivedSecrets) RootKey ¶
func (d *DerivedSecrets) RootKey() []byte
RootKey returns the RootKey bytes.
type KeyPair ¶
type KeyPair struct { RootKey RootKeyable ChainKey ChainKeyable }
KeyPair is a session key pair that holds a single root and chain key pair. These keys are ratcheted after every message sent and every message round trip.
func NewKeyPair ¶
func NewKeyPair(rootKey RootKeyable, chainKey ChainKeyable) *KeyPair
NewKeyPair returns a new session key pair that holds a root and chain key.
type RootKeyable ¶
type RootKeyable interface { Bytes() []byte CreateChain(theirRatchetKey ecc.ECPublicKeyable, ourRatchetKey *ecc.ECKeyPair) (*KeyPair, error) }
RootKeyable is an interface for all root key implementations that are part of a session keypair.
Source Files ¶
DerivedSecrets.go Pair.go
- Version
- v0.1.2 (latest)
- Published
- Feb 12, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 1 week ago –
Tools for package owners.