Documentation ¶
Index ¶
- Variables
- func BytesToPrivateKey(priv string) *rsa.PrivateKey
- func BytesToPublicKey(pub string) *rsa.PublicKey
- func ConnectServer(ip, username string) (*client, error)
- func CreateKey() ([]byte, []byte, error)
- func DecryptAes(chiperText, key, IV []byte) []byte
- func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) []byte
- func EncryptAes(plainText []byte, key, IV []byte) []byte
- func EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey) []byte
- func GenerateRSAKey(myUsername string)
- func StartClient(serverIP, username string)
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ServerIP string
)
Functions ¶
func BytesToPrivateKey ¶
func BytesToPrivateKey(priv string) *rsa.PrivateKey
BytesToPrivateKey bytes to private key
func BytesToPublicKey ¶
BytesToPublicKey bytes to public key
func ConnectServer ¶
ConnectServer is to connect to clients
func DecryptAes ¶
func DecryptWithPrivateKey ¶
func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) []byte
DecryptWithPrivateKey decrypts data with private key
func EncryptAes ¶
func EncryptWithPublicKey ¶
EncryptWithPublicKey encrypts data with public key
func GenerateRSAKey ¶
func GenerateRSAKey(myUsername string)
GenerateRSAKey create 2 file, the private and public key
Types ¶
Click to show internal directories.
Click to hide internal directories.