PublicKey returns a base64 encoded public key. Useful for transport (like in HTTP requests)
()
| 57 | |
| 58 | // PublicKey returns a base64 encoded public key. Useful for transport (like in HTTP requests) |
| 59 | func (e *Encrypter) PublicKey() string { |
| 60 | return base64.URLEncoding.EncodeToString(e.publicKey[:]) |
| 61 | } |
| 62 | |
| 63 | // Decrypt data that was encrypted using our publicKey. It will use our privateKey and the sender's publicKey to decrypt |
| 64 | // data is an encrypted buffer of data, mostly like from the Encrypt function. Messages contain the nonce data on the front |