identity

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package identity handles ed25519 keypairs: loading private keys, parsing public keys, and signing/verifying request preimages. Keypairs are generated outside AgentStore with ssh-keygen; only the public key is ever sent to a server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadPrivateKey

func LoadPrivateKey(path string) (ed25519.PrivateKey, error)

LoadPrivateKey reads an OpenSSH-format ed25519 private key file.

func ParsePublicKey

func ParsePublicKey(authorizedKey string) (ed25519.PublicKey, error)

ParsePublicKey parses an OpenSSH authorized-key line into an ed25519 public key.

func PrivateKeyPathFromPublic

func PrivateKeyPathFromPublic(pubPath string) string

PrivateKeyPathFromPublic derives the conventional private key path from a public key path by stripping a trailing ".pub" (ssh-keygen's convention).

func ReadPublicKeyFile

func ReadPublicKeyFile(path string) (string, error)

ReadPublicKeyFile reads an OpenSSH .pub file and returns the canonical authorized-key line (without trailing newline).

func Sign

func Sign(priv ed25519.PrivateKey, preimage []byte) []byte

Sign signs the preimage with the private key.

func Verify

func Verify(pub ed25519.PublicKey, preimage, sig []byte) bool

Verify reports whether sig is a valid signature of preimage by pub.

Types

This section is empty.

Jump to

Keyboard shortcuts

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