Documentation
¶
Index ¶
- func MustParseRsaPublicKey(key []byte) *rsa.PublicKey
- func ParseRsaPublicKey(key []byte) (*rsa.PublicKey, error)
- func PipeCommands(commands ...*exec.Cmd) ([]byte, error)
- func SafeJoin(parent, subdir string) (string, error)
- func SaveFileonTempDir(filename string, data io.Reader) (string, error)
- func TellCommandNotToSpawnShell(_ *exec.Cmd)
- func UserPrompt(dialog string, buttons string, defaultButton string, toPress string, ...) bool
- func VerifyInput(input string, signature string, pubKey *rsa.PublicKey) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustParseRsaPublicKey ¶
MustParseRsaPublicKey parses a public key in PEM format and returns the rsa.PublicKey object. Panics if the key is invalid.
func ParseRsaPublicKey ¶
ParseRsaPublicKey parses a public key in PEM format and returns the rsa.PublicKey object. Returns an error if the key is invalid.
func PipeCommands ¶
PipeCommands executes the commands received as input by feeding the output of one to the input of the other, exactly like Unix Pipe (|). Returns the output of the final command and the eventual error.
code inspired by https://gist.github.com/tyndyll/89fbb2c2273f83a074dc
func SafeJoin ¶
SafeJoin performs a filepath.Join of 'parent' and 'subdir' but returns an error if the resulting path points outside of 'parent'.
func SaveFileonTempDir ¶
SaveFileonTempDir creates a temp directory and saves the file data as the filename in that directory. Returns an error if the agent doesn't have permission to create the folder. Returns an error if the filename doesn't form a valid path.
Note that path could be defined and still there could be an error.
func TellCommandNotToSpawnShell ¶
TellCommandNotToSpawnShell will now spawn a shell
Types ¶
This section is empty.