encryption

package
v0.0.0-...-5f71cfe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCertManager

func CreateCertManager(datadir string, letsencryptDomain string) (*autocert.Manager, error)

CreateCertManager wraps common logic of generating Let's encrypt certificate.

func Decrypt

func Decrypt(encryptedMsg []byte, peerPublicKey wgtypes.Key, privateKey wgtypes.Key) ([]byte, error)

Decrypt decrypts a message that has been encrypted by the remote peer using Wireguard private key and remote peer's public key.

func DecryptMessage

func DecryptMessage(remotePubKey wgtypes.Key, ourPrivateKey wgtypes.Key, encryptedMessage []byte, message pb.Message) error

DecryptMessage decrypts an encrypted message into given protobuf Message

func Encrypt

func Encrypt(msg []byte, peerPublicKey wgtypes.Key, privateKey wgtypes.Key) ([]byte, error)

Encrypt encrypts a message using local Wireguard private key and remote peer's public key.

func EncryptMessage

func EncryptMessage(remotePubKey wgtypes.Key, ourPrivateKey wgtypes.Key, message pb.Message) ([]byte, error)

EncryptMessage encrypts a body of the given protobuf Message

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL