Documentation
¶
Index ¶
- type KeyStore
- func (ks *KeyStore) DecryptMessage(encrypted *shared.EncryptedMessage, conversationID string) (*shared.Message, error)
- func (ks *KeyStore) DecryptRaw(data []byte, conversationID string) ([]byte, error)
- func (ks *KeyStore) EncryptMessage(sender, content, conversationID string) (*shared.EncryptedMessage, error)
- func (ks *KeyStore) EncryptRaw(data []byte, conversationID string) ([]byte, error)
- func (ks *KeyStore) GetGlobalKey() *shared.SessionKey
- func (ks *KeyStore) GetSessionKey(conversationID string) *shared.SessionKey
- func (ks *KeyStore) Initialize(passphrase string) error
- func (ks *KeyStore) Load(passphrase string) error
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 ¶
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) DecryptRaw ¶
DecryptRaw decrypts raw bytes using the session key for the given conversation. The input should be nonce || ciphertext.
func (*KeyStore) EncryptMessage ¶
func (ks *KeyStore) EncryptMessage(sender, content, conversationID string) (*shared.EncryptedMessage, error)
EncryptMessage encrypts a message for a specific conversation
func (*KeyStore) EncryptRaw ¶
EncryptRaw encrypts raw bytes using the session key for the given 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 ¶
Initialize initializes the keystore for global encryption only