wg

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package wg provides WireGuard key material helpers shared across the gateway control plane.

Index

Constants

View Source
const (
	// BundleKey is the single data key in the gateway-bundle Secret. Its value is
	// "<gateway_private_key>\n<link_public_key>\n".
	BundleKey = "bundle"
	// LinkPrivateKey is the link Secret data key holding the link's WireGuard
	// private key.
	LinkPrivateKey = "private"
	// LinkPeerPublicKey is the link Secret data key holding the gateway's
	// WireGuard public key (the link's sole peer).
	LinkPeerPublicKey = "peerPublicKey"
)

Secret data keys shared between the key generator and the consumers of the WireGuard key material. The gateway VM fetches its bundle from GCP Secret Manager, so both ends must agree on these constants.

Variables

This section is empty.

Functions

func GenerateKeypair

func GenerateKeypair() (privateKey, publicKey string, err error)

GenerateKeypair generates a Curve25519 WireGuard keypair. Both returned keys are standard base64-encoded 32-byte WireGuard keys (the same encoding `wg` emits and accepts); publicKey is deterministically derived from privateKey.

Types

This section is empty.

Jump to

Keyboard shortcuts

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