encryption

package
v0.29.3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: BSD-3-Clause Imports: 17 Imported by: 9

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

func LoadTLSConfig added in v0.29.0

func LoadTLSConfig(certFile, keyFile string) (*tls.Config, error)

Types

type Route53TLS added in v0.29.0

type Route53TLS struct {
	DataDir string
	Email   string
	Domains []string
	CA      string
}

Route53TLS by default, loads the AWS configuration from the environment. env variables: AWS_REGION, AWS_PROFILE, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN

func (*Route53TLS) GetCertificate added in v0.29.0

func (r *Route53TLS) GetCertificate() (*tls.Config, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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