Documentation ¶
Index ¶
- func Base64Decode(data string) []byte
- func Base64Encode(data []byte) string
- func BytesToPrivateKey(privData []byte) *rsa.PrivateKey
- func BytesToPublicKey(pubData []byte) *rsa.PublicKey
- func DecryptAES(key, data []byte) []byte
- func DecryptRSA(priv *rsa.PrivateKey, data []byte) []byte
- func EncryptAES(key, data []byte) []byte
- func EncryptRSA(pub *rsa.PublicKey, data []byte) []byte
- func GenerateBytes(max uint) []byte
- func GenerateKey(bits uint) *rsa.PrivateKey
- func Get(key string) interface{}
- func HashPublicKey(pub *rsa.PublicKey) string
- func HashSum(data []byte) []byte
- func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
- func PrivateKeyToString(priv *rsa.PrivateKey) string
- func ProofIsValid(packHash []byte, diff uint, nonce uint64) bool
- func ProofOfWork(packHash []byte, diff uint) uint64
- func PublicKeyToBytes(pub *rsa.PublicKey) []byte
- func PublicKeyToString(pub *rsa.PublicKey) string
- func RaiseEntropy(info, salt []byte, bits int) []byte
- func SerializePackage(pack *Package) string
- func Set(settings SettingsType) []uint8
- func Sign(priv *rsa.PrivateKey, data []byte) []byte
- func StringToPrivateKey(privData string) *rsa.PrivateKey
- func StringToPublicKey(pubData string) *rsa.PublicKey
- func ToBytes(num uint64) []byte
- func Verify(pub *rsa.PublicKey, data, sign []byte) error
- type BodyPackage
- type Client
- func (client *Client) Connect(address string) error
- func (client *Client) Decrypt(pack *Package) *Package
- func (client *Client) Disconnect(address string)
- func (client *Client) Encrypt(receiver *rsa.PublicKey, pack *Package) *Package
- func (client *Client) Handle(title string, pack *Package, handle func(*Client, *Package) string)
- func (client *Client) PrivateKey() *rsa.PrivateKey
- func (client *Client) PublicKey() *rsa.PublicKey
- func (client *Client) RoutePackage(receiver *rsa.PublicKey, pack *Package, route []*rsa.PublicKey, ...) *Package
- func (client *Client) RunNode(address string) error
- func (client *Client) Send(receiver *rsa.PublicKey, pack *Package, route []*rsa.PublicKey, ...) (string, error)
- type HeadPackage
- type Package
- type SettingsType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Decode ¶
func Base64Encode ¶
func BytesToPrivateKey ¶ added in v1.2.6
func BytesToPrivateKey(privData []byte) *rsa.PrivateKey
func BytesToPublicKey ¶ added in v1.2.6
func DecryptAES ¶
func DecryptRSA ¶
func DecryptRSA(priv *rsa.PrivateKey, data []byte) []byte
func EncryptAES ¶
func GenerateBytes ¶ added in v1.2.0
func GenerateKey ¶ added in v1.2.6
func GenerateKey(bits uint) *rsa.PrivateKey
func HashPublicKey ¶ added in v1.2.6
func PrivateKeyToBytes ¶ added in v1.2.6
func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
func PrivateKeyToString ¶ added in v1.2.6
func PrivateKeyToString(priv *rsa.PrivateKey) string
func ProofIsValid ¶ added in v1.2.1
func ProofOfWork ¶
func PublicKeyToBytes ¶ added in v1.2.6
func PublicKeyToString ¶ added in v1.2.6
func RaiseEntropy ¶ added in v1.2.6
func SerializePackage ¶ added in v1.2.2
func Set ¶
func Set(settings SettingsType) []uint8
func StringToPrivateKey ¶ added in v1.2.6
func StringToPrivateKey(privData string) *rsa.PrivateKey
func StringToPublicKey ¶ added in v1.2.6
Types ¶
type BodyPackage ¶ added in v1.2.0
type Client ¶
type Client struct { F2F *friendToFriend // contains filtered or unexported fields }
func NewClient ¶ added in v1.2.0
func NewClient(priv *rsa.PrivateKey, handle func(*Client, *Package)) *Client
func (*Client) Disconnect ¶
func (*Client) PrivateKey ¶ added in v1.2.6
func (client *Client) PrivateKey() *rsa.PrivateKey
func (*Client) RoutePackage ¶ added in v1.2.6
type HeadPackage ¶ added in v1.2.0
type Package ¶
type Package struct { Head HeadPackage `json:"head"` Body BodyPackage `json:"body"` }
func DeserializePackage ¶ added in v1.2.2
func NewPackage ¶ added in v1.2.3
type SettingsType ¶
type SettingsType map[string]interface{}
Click to show internal directories.
Click to hide internal directories.