Documentation ¶
Index ¶
- type AES
- type Chat
- type ChatInformation
- type Conversation
- type ConversationInfo
- type DesktopInformation
- type ECDH
- type Header
- type InitialMessage
- type InitializingData
- type MessageEncrypted
- type MessageKey
- type MessageKeyInitializer
- type MessageUnencrypted
- type Messages
- type NegotiateKeysMessage
- type RSA
- type TextMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AES ¶
type AES interface { Encrypt([]byte, []byte, []byte) ([]byte, error) Decrypt([]byte, []byte, []byte) ([]byte, error) GenerateAESKey(io.Reader) ([]byte, error) GenerateAESNonce(io.Reader) ([]byte, error) EncryptHeader(Header, []byte, []byte) ([]byte, error) DecryptHeader([]byte, []byte, []byte) (*Header, error) EncryptMessageBody(interface{}, []byte, []byte) ([]byte, error) DecryptMessageBody([]byte, []byte, []byte, int) (interface{}, error) }
type Chat ¶
type Chat interface { InitializeConversation(*string) (*string, error) InitiateConnection() error NegotiateNewKeys() error SendTextMessage(string) error State() ChatInformation StartServer() StartKeyNegotiatingService() }
func NewChat ¶
func NewChat(chatInformation ChatInformation) Chat
type ChatInformation ¶
type ChatInformation struct { Hostname string PartnerHostname string Name string Host bool Conversation Conversation }
type Conversation ¶
type Conversation interface { CreateSendKeyInitializers(int) ([]MessageKeyInitializer, error) CreateReceiveKeyInitializers(int) ([]MessageKeyInitializer, error) ComputeKeyMessages([]MessageKeyInitializer, []MessageKeyInitializer) ([]MessageKey, error) State() ConversationInfo ReceiveMessage(MessageEncrypted) error GetSendMessageKey(int) (*MessageKey, error) GetReceiveMessageKey(int) (*MessageKey, error) GetReceiveMessageKeyInitializer(int) (*MessageKeyInitializer, error) RemoveReceiveMessageKey(int) error RemoveSendMessageKey(int) error HandleNegotiateKeysMessage(*NegotiateKeysMessage) error HandleTextMessage(*TextMessage) error PrepareMessage(MessageUnencrypted) (*MessageEncrypted, error) SendMessage(MessageEncrypted) error PrepareNegotiateKeysMessage(*[]MessageKeyInitializer, *[]MessageKeyInitializer) error StartConnection(MessageUnencrypted) error NegotiateKeys(MessageUnencrypted) error ReceiveMessageProcessor(chan MessageEncrypted) StartSendService() }
func NewConversation ¶
func NewConversation(info ConversationInfo) Conversation
type ConversationInfo ¶
type ConversationInfo struct { Hostname string PrivateKey rsa.PrivateKey PublicKey rsa.PublicKey SendingMessageKeys []MessageKey SendingMessageKeyInitializers []MessageKeyInitializer ReceivingMessageKeys []MessageKey ReceivingMessageKeyInitializers []MessageKeyInitializer SendingMessageIndex int SendingMessageKeyInitializersIndex int ReceivingMessageIndex int ReceivingMessageKeyInitializersIndex int PartnerPublicKey *rsa.PublicKey PartnerHostname string SendQueue chan MessageUnencrypted ReceiveQueue chan MessageEncrypted DisplayQueue chan TextMessage }
type DesktopInformation ¶
type ECDH ¶
type ECDH interface { GenerateKey(io.Reader) (crypto.PrivateKey, crypto.PublicKey, error) Marshal(crypto.PublicKey) []byte Unmarshal([]byte) (crypto.PublicKey, bool) }
func NewCurve25519ECDH ¶
func NewCurve25519ECDH() ECDH
type InitialMessage ¶
type InitialMessage struct { PublicKey rsa.PublicKey PartnerPublicKeys []MessageKeyInitializer }
type InitializingData ¶
type InitializingData struct { Hostname string PublicKey rsa.PublicKey SendingMessageKeys []MessageKey ReceivingMessageKeys []MessageKey }
type MessageEncrypted ¶
type MessageKey ¶
type MessageKeyInitializer ¶
type MessageKeyInitializer struct { ID int PublicKey []byte PrivateKey crypto.PrivateKey Key []byte }
type MessageUnencrypted ¶
type Messages ¶
type Messages interface { EncryptMessage(MessageUnencrypted, MessageKey, rsa.PrivateKey) (*MessageEncrypted, error) DecryptMessage(MessageEncrypted, MessageKey) (*MessageUnencrypted, error) SignMessage(io.Reader, rsa.PrivateKey, MessageEncrypted) (*MessageEncrypted, error) VerifyMessage(io.Reader, rsa.PublicKey, MessageEncrypted) error }
func NewMessages ¶
func NewMessages() Messages
type NegotiateKeysMessage ¶
type NegotiateKeysMessage struct { HostPublicKeys *[]MessageKeyInitializer PartnerPublicKeys *[]MessageKeyInitializer }
type TextMessage ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.