did

package
v0.0.0-...-e617a74 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeDIDKey

func DecodeDIDKey(did string) (ed25519.PublicKey, error)

DecodeDIDKey parses a DID:key string and returns the Ed25519 public key.

func EncodeDIDKey

func EncodeDIDKey(pub ed25519.PublicKey) string

EncodeDIDKey converts an Ed25519 public key to a DID:key string. Format: did:key:z<base58btc(multicodec_prefix + public_key_bytes)>

func GenerateKeypair

func GenerateKeypair() (ed25519.PublicKey, ed25519.PrivateKey, error)

GenerateKeypair creates a new Ed25519 keypair.

func LoadPrivateKey

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

LoadPrivateKey reads an Ed25519 private key from a PEM file.

func LoadPublicKey

func LoadPublicKey(path string) (ed25519.PublicKey, error)

LoadPublicKey reads an Ed25519 private key from PEM and returns the public key.

func SavePrivateKey

func SavePrivateKey(path string, key ed25519.PrivateKey) error

SavePrivateKey writes an Ed25519 private key to a PEM file with secure permissions. On Unix: Uses 0600 permissions (owner read/write only). On Windows: Uses ACLs to restrict access to current user only.

Types

This section is empty.

Jump to

Keyboard shortcuts

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