Documentation
¶
Index ¶
- func DecodeDIDKey(did string) (ed25519.PublicKey, error)
- func EncodeDIDKey(pub ed25519.PublicKey) string
- func GenerateKeypair() (ed25519.PublicKey, ed25519.PrivateKey, error)
- func LoadPrivateKey(path string) (ed25519.PrivateKey, error)
- func LoadPublicKey(path string) (ed25519.PublicKey, error)
- func SavePrivateKey(path string, key ed25519.PrivateKey) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeDIDKey ¶
DecodeDIDKey parses a DID:key string and returns the Ed25519 public key.
func EncodeDIDKey ¶
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.