Documentation
¶
Overview ¶
Package x25519 provides X25519 key pair helpers for v3 onion service client authorization. The generated keys are used by the "ONION_CLIENT_AUTH_*" controller commands (client side, base64-encoded private key) and the ADD_ONION "ClientAuthV3" flag / "descriptor:x25519:" auth files (service side, base32-encoded public key).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyPair ¶
type KeyPair struct {
// contains filtered or unexported fields
}
KeyPair is an X25519 key pair used for v3 onion service client authorization.
func FromPrivateKey ¶
FromPrivateKey builds a KeyPair from a raw 32-byte X25519 private key.
func FromPrivateKeyBase64 ¶
FromPrivateKeyBase64 builds a KeyPair from a base64-encoded raw X25519 private key, the form used by the ONION_CLIENT_AUTH_ADD command.
func Generate ¶
Generate creates a new random X25519 key pair. If rng is nil, crypto/rand.Reader is used.
func (*KeyPair) PrivateKey ¶
PrivateKey returns the raw 32-byte X25519 private key.
func (*KeyPair) PrivateKeyBase64 ¶
PrivateKeyBase64 returns the base64-encoded private key, the form expected by the ONION_CLIENT_AUTH_ADD controller command (client side).
func (*KeyPair) PublicKeyBase32 ¶
PublicKeyBase32 returns the base32-encoded public key, the form expected by the ADD_ONION "ClientAuthV3" flag and "descriptor:x25519:" client auth files (service side).