Documentation ¶
Index ¶
- func GenerateKeys() (publicKey, privateKey string)
- func GenerateKeysDeterministic(seedBytes []byte) (publicKey, privateKey string)
- type KeyPair
- func (kp KeyPair) Decrypt(encrypted []byte, sender KeyPair) (msg []byte, err error)
- func (kp KeyPair) Encrypt(msg []byte, recipient KeyPair) (encrypted []byte, err error)
- func (kp KeyPair) Hash() string
- func (kp KeyPair) MarshalJSON() ([]byte, error)
- func (kp KeyPair) PublicKey() (kpPublic KeyPair)
- func (kp KeyPair) Signature(regionkey KeyPair) (signature string, err error)
- func (kp *KeyPair) UnmarshalJSON(b []byte) (err error)
- func (kp KeyPair) Validate(signature string, sender KeyPair) (err error)
- type KeyPairJSON
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKeys ¶
func GenerateKeys() (publicKey, privateKey string)
Types ¶
type KeyPair ¶
type KeyPair struct { Public string `json:"public"` Private string `json:"private,omitempty"` // contains filtered or unexported fields }
func FromPublic ¶
FromPublic generates a half-key pair
func NewDeterministic ¶
func (KeyPair) MarshalJSON ¶
func (KeyPair) Signature ¶
Signature returns your public key encrypted by a shared region key. Anyone who has the shared region key can decrypt this and see that the contents do indeed match that public key used to make it.
func (*KeyPair) UnmarshalJSON ¶
type KeyPairJSON ¶
Click to show internal directories.
Click to hide internal directories.