Documentation
¶
Overview ¶
Package salty is a library and set of command-line (cli) tools for working with ED25519 keys and th saltpack message format
Index ¶
- Variables
- func Decrypt(key *keys.EdX25519Key, input []byte) ([]byte, *keys.EdX25519PublicKey, error)
- func Encrypt(key *keys.EdX25519Key, input []byte, recipients []string) ([]byte, error)
- func FullVersion() string
- func GenerateKeys(pwd string, out io.Writer) (*keys.EdX25519Key, string)
- func ParseIdentity(pwd string, r io.Reader) (*keys.EdX25519Key, error)
- func ParseSSHKey(pwd string, r io.Reader) (*keys.EdX25519Key, error)
- func Sign(key *keys.EdX25519Key, input []byte) ([]byte, error)
- func Verify(input []byte) ([]byte, keys.ID, error)
Constants ¶
This section is empty.
Variables ¶
var ( // Version release version Version = "0.0.1" // Commit will be overwritten automatically by the build system Commit = "HEAD" )
var ( // ErrProtectedKey is an error returned when a private key is protected by a password, but none was provided. ErrProtectedKey = errors.New("error: key protected by a password") )
Functions ¶
func Decrypt ¶
func Decrypt(key *keys.EdX25519Key, input []byte) ([]byte, *keys.EdX25519PublicKey, error)
Decrypt decrypts the `input` using the Private Key `key` and returns the unencrypted bytes and the sender's public key on success, or nill bytes and a nil sender on failure.
func Encrypt ¶
Encrypt encrypts the `input` using the Private Key `key` to the Public Keys of the `recipients`. Armour serializing is used by default. The armour bytes are returned on success or nil bytes and an error on failure.
func GenerateKeys ¶
GenerateKeys creates a new pair of Ed25519 keys and writes the Private Key to the `out io.Writer` and returns the Private and Public Keys. The Private Key written to `out` is Base64 encoded.
func ParseIdentity ¶
ParseIdentity parses the Salty Identity file given by `r io.Reader` which has a line-oriented format where comments (lines beginning with a #) and the and blank lines are ignored and the private key is the first non-comment / non-blank line. The Private Key is a Base64 decoded. This returns the parsed Ed25519 key on success or nil key and error if it fails.
func ParseSSHKey ¶
ParseSSHKey parses a ED25519 SSH Key (compatible with Salty) file given by `r io.Reader`. The Private Key is a PEM decoded. This returns the parsed Ed25519 key on success or nil key and error if it fails.
Types ¶
This section is empty.
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
salty
Package main is the salty command-line (cli) tool
|
Package main is the salty command-line (cli) tool |
salty-keygen
Package main is the salty-keygen command-line (cli) tool
|
Package main is the salty-keygen command-line (cli) tool |