Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Encrypt ¶
Encrypt performs AES-GCM encryption on the input message using the provided symmetric key. It returns the base64-encoded ciphertext which includes the nonce. If encryption fails, it returns the original message unchanged.
func LoadPrivateKey ¶
func LoadPrivateKey(path string) (ed25519.PrivateKey, error)
LoadPrivateKey loads an Ed25519 private key from the specified PEM file path. If path is empty, it generates a new Ed25519 key pair and returns the private key. It returns the private key and any error encountered.
func LoadSymmetricKey ¶
LoadSymmetricKey loads a 32-byte symmetric key from the specified file path. If path is empty, it generates a new random key. The key file content can be either raw bytes or base64 encoded. It returns the key and any error encountered.
Types ¶
This section is empty.