glm_encrypted_file/encfile

Types

Error types for this library

pub type EncFileError {
  DecryptEncryptedFileError(List(String), #(Int, String))
  EncryptEncryptedFileError(List(String), #(Int, String))
}

Constructors

  • DecryptEncryptedFileError(List(String), #(Int, String))
  • EncryptEncryptedFileError(List(String), #(Int, String))

A file containing encrpted content

pub type EncryptedFile {
  EncryptedFile(path: String)
}

Constructors

  • EncryptedFile(path: String)

A file containing a password

pub type PasswordFile {
  PasswordFile(path: String)
}

Constructors

  • PasswordFile(path: String)

A file containing plaintext

pub type PlaintextFile {
  PlaintextFile(path: String)
}

Constructors

  • PlaintextFile(path: String)

Values

pub fn decrypt(
  encrypted_file: EncryptedFile,
  password_file: PasswordFile,
) -> Result(String, EncFileError)

Decrypt an encrypted file

pub fn encrypt(
  plaintext_file: PlaintextFile,
  encrypted_file: EncryptedFile,
  password_file: PasswordFile,
) -> Result(Nil, EncFileError)

Encrypt a plaintext file

pub fn new_encrypted_file(f: String) -> EncryptedFile

Construct an encrypted file

pub fn new_password_file(f: String) -> PasswordFile

Construct a password file

pub fn new_plaintext_file(f: String) -> PlaintextFile

Construct a plaintext file

Search Document