PeachScriptExport.kt
1package com.peachpasswords.ui.vault23import com.peachpasswords.vault.PeachPayloadCodec4import com.peachpasswords.vault.PeachScript5import com.peachpasswords.vault.VaultEntry67/**8 * PeachScript export (MF-2) — writes the browser's PCHS binary payload9 * (Argon2id + AES-256-GCM, zstd sections, BLAKE3 checksum, size-bucket padding,10 * string-table entry packing) re-encoded into Private-Use-Area text. The output11 * is importable by the browser extension and carries the full entry field set.12 *13 * The heavy lifting lives in [PeachPayloadCodec] (binary) and [PeachScript]14 * (PUA codec); this object is just the export entry point the UI calls.15 */16object PeachScriptExport {1718 /**19 * Encrypted PeachScript export of [entries], protected by [backupPassword].20 * PeachScript is always encrypted (the browser format has no plaintext mode).21 */22 fun buildEncrypted(entries: List<VaultEntry>, backupPassword: String): String =23 PeachScript.encode(PeachPayloadCodec.buildPayload(entries, backupPassword))24}