CryptoFileHelper

Helpers for persisting crypto results to the app cache and sharing them, plus heuristics for deriving output file names from an input name.

Functions

Link copied to clipboard

Derives a decrypted output name by stripping a .gpg/.pgp/.asc suffix.

Link copied to clipboard

Derives an encrypted output name for inputName, appending .gpg when needed.

Link copied to clipboard

Derives a detached signature name for inputName, appending .sig when needed.

Link copied to clipboard
suspend fun shareBytes(context: Context, data: ByteArray, fileName: String, mimeType: String)

Writes data to a cache file and launches a system share sheet for it.

Link copied to clipboard
suspend fun writeCacheFile(context: Context, data: ByteArray, fileName: String): Uri

Writes data into the shared cache directory and returns a content Uri for it.