Documentation
¶
Index ¶
- type KeyStore
- func (ks *KeyStore) DecryptMessage(encrypted *shared.EncryptedMessage, conversationID string) (*shared.Message, error)
- func (ks *KeyStore) DeriveSessionKey(otherUsername, conversationID string) (*shared.SessionKey, error)
- func (ks *KeyStore) EncryptMessage(sender, content, conversationID string) (*shared.EncryptedMessage, error)
- func (ks *KeyStore) GetGlobalKey() *shared.SessionKey
- func (ks *KeyStore) GetKeyPair() *shared.KeyPair
- func (ks *KeyStore) GetMyPublicKey() []byte
- func (ks *KeyStore) GetPublicKey(username string) *shared.PublicKeyInfo
- func (ks *KeyStore) GetPublicKeyInfo(username string) *shared.PublicKeyInfo
- func (ks *KeyStore) GetSessionKey(conversationID string) *shared.SessionKey
- func (ks *KeyStore) Initialize(passphrase string) error
- func (ks *KeyStore) Load(passphrase string) error
- func (ks *KeyStore) StorePublicKey(pubKeyInfo *shared.PublicKeyInfo) 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
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) DeriveSessionKey ¶
func (ks *KeyStore) DeriveSessionKey(otherUsername, conversationID string) (*shared.SessionKey, error)
DeriveSessionKey creates a session key for a conversation
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) GetKeyPair ¶
GetKeyPair returns the user's keypair
func (*KeyStore) GetMyPublicKey ¶
GetMyPublicKey returns the user's public key
func (*KeyStore) GetPublicKey ¶
func (ks *KeyStore) GetPublicKey(username string) *shared.PublicKeyInfo
GetPublicKey retrieves another user's public key
func (*KeyStore) GetPublicKeyInfo ¶
func (ks *KeyStore) GetPublicKeyInfo(username string) *shared.PublicKeyInfo
GetPublicKeyInfo returns the user's public key info for distribution
func (*KeyStore) GetSessionKey ¶
func (ks *KeyStore) GetSessionKey(conversationID string) *shared.SessionKey
GetSessionKey retrieves a session key for a conversation
func (*KeyStore) Initialize ¶
Initialize creates a new keypair if one doesn't exist
func (*KeyStore) StorePublicKey ¶
func (ks *KeyStore) StorePublicKey(pubKeyInfo *shared.PublicKeyInfo) error
StorePublicKey stores another user's public key