crypto

package
v0.7.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyStore

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

KeyStore manages cryptographic keys for the client (global encryption only)

func NewKeyStore

func NewKeyStore(keystorePath string) *KeyStore

NewKeyStore creates a new key store

func (*KeyStore) DecryptMessage

func (ks *KeyStore) DecryptMessage(encrypted *shared.EncryptedMessage, conversationID string) (*shared.Message, error)

DecryptMessage decrypts a message using the appropriate session key

func (*KeyStore) EncryptMessage

func (ks *KeyStore) EncryptMessage(sender, content, conversationID string) (*shared.EncryptedMessage, error)

EncryptMessage encrypts a message for a specific conversation

func (*KeyStore) GetGlobalKey

func (ks *KeyStore) GetGlobalKey() *shared.SessionKey

GetGlobalKey returns the global session key

func (*KeyStore) GetSessionKey

func (ks *KeyStore) GetSessionKey(conversationID string) *shared.SessionKey

GetSessionKey retrieves the global session key (only global encryption supported)

func (*KeyStore) Initialize

func (ks *KeyStore) Initialize(passphrase string) error

Initialize initializes the keystore for global encryption only

func (*KeyStore) Load

func (ks *KeyStore) Load(passphrase string) error

Load loads the keystore from disk

Jump to

Keyboard shortcuts

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