Documentation ¶
Index ¶
- func Base64Decode(data string) []byte
- func Base64Encode(data []byte) string
- 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 GeneratePrivate(bits uint) *rsa.PrivateKey
- func Get(key string) interface{}
- func Handle(title string, client *Client, pack *Package, ...)
- func HashPublic(pub *rsa.PublicKey) string
- func HashSum(data []byte) []byte
- func ParsePrivate(privData string) *rsa.PrivateKey
- func ParsePublic(pubData string) *rsa.PublicKey
- func ProofIsValid(packHash []byte, diff uint, nonce uint64) bool
- func ProofOfWork(packHash []byte, diff uint) uint64
- func SerializePackage(pack *Package) string
- func Set(settings SettingsType) []uint8
- func Sign(priv *rsa.PrivateKey, data []byte) []byte
- func StringPrivate(priv *rsa.PrivateKey) string
- func StringPublic(pub *rsa.PublicKey) string
- func ToBytes(num uint64) []byte
- func Verify(pub *rsa.PublicKey, data, sign []byte) error
- type BodyPackage
- type Client
- func (client *Client) AppendF2F(pub *rsa.PublicKey)
- func (client *Client) Connect(address string) error
- func (client *Client) Decrypt(pack *Package) *Package
- func (client *Client) DisableF2F()
- func (client *Client) Disconnect(address string)
- func (client *Client) EnableF2F()
- func (client *Client) Encrypt(receiver *rsa.PublicKey, pack *Package) *Package
- func (client *Client) F2F() bool
- func (client *Client) HashPublic() string
- func (client *Client) InF2F(pub *rsa.PublicKey) bool
- func (client *Client) ListF2F() []rsa.PublicKey
- func (client *Client) Private() *rsa.PrivateKey
- func (client *Client) Public() *rsa.PublicKey
- func (client *Client) RemoveF2F(pub *rsa.PublicKey)
- func (client *Client) Send(receiver *rsa.PublicKey, pack *Package, route []*rsa.PublicKey, ...) (string, error)
- func (client *Client) SetHandle(handle func(*Client, *Package)) *Client
- func (client *Client) StringPrivate() string
- func (client *Client) StringPublic() string
- type HeadPackage
- type Node
- type Package
- type SettingsType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Decode ¶
func Base64Encode ¶
func DecryptAES ¶
func DecryptRSA ¶
func DecryptRSA(priv *rsa.PrivateKey, data []byte) []byte
func EncryptAES ¶
func GenerateBytes ¶ added in v1.2.0
func GeneratePrivate ¶
func GeneratePrivate(bits uint) *rsa.PrivateKey
func HashPublic ¶
func ParsePrivate ¶
func ParsePrivate(privData string) *rsa.PrivateKey
func ParsePublic ¶
func ProofIsValid ¶ added in v1.2.1
func ProofOfWork ¶
func SerializePackage ¶ added in v1.2.2
func Set ¶
func Set(settings SettingsType) []uint8
func StringPrivate ¶
func StringPrivate(priv *rsa.PrivateKey) string
func StringPublic ¶
Types ¶
type BodyPackage ¶ added in v1.2.0
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶ added in v1.2.0
func NewClient(priv *rsa.PrivateKey) *Client
func (*Client) DisableF2F ¶ added in v1.2.0
func (client *Client) DisableF2F()
func (*Client) Disconnect ¶
func (*Client) HashPublic ¶ added in v1.2.0
func (*Client) Private ¶ added in v1.1.2
func (client *Client) Private() *rsa.PrivateKey
func (*Client) StringPrivate ¶ added in v1.2.0
func (*Client) StringPublic ¶ added in v1.2.0
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.