glm_encrypted_file/openssl
Types
Error types for this library
pub type OpenSslError {
OpenSslError(Int, String)
}
Constructors
-
OpenSslError(Int, String)OpenSslError is the shellout error passed through. From the shellout docs:
‘’‘An Error result wraps a tuple in which the first element is an OS error status code and the second is a message about what went wrong (or an empty string).’‘’
- Int: is the os error status code
- String: message about what went wrong
Values
pub fn decrypt(
encrypted_file: String,
password_file: String,
) -> Result(String, OpenSslError)
Decrypt an encrypted file to a plaintext string
pub fn encrypt(
plaintext_file: String,
encrypted_file: String,
password_file: String,
) -> Result(Nil, OpenSslError)
Encrypt a plaintext string to an encrypted file
See README for details, but in short: you must ensure that both the plaintext file and the password file are secure. Delete the plaintext file once the encrypted file has been created from it.
TODO: investigate sending plaintext over stdin to openssl shellout process TODO: see https://github.com/tynanbe/shellout/issues/4