mirror of
https://github.com/block/buzz.git
synced 2026-10-28 13:01:10 +00:00
Add Android HPKE sealing, bounded native key-file import, guarded export, explicit cloud-key selection, and retry-safe self-hosted setup. Route hosted pairing through account admission and preserve first-successful batch landing. Keep account eligibility failures and setup progress on the entry surface. Co-authored-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
21 lines
824 B
Java
21 lines
824 B
Java
import java.util.Base64;
|
|
import xyz.block.buzz.mobile.HostedHpkeBackup;
|
|
|
|
/** Seals test-only fixture bytes with the actual compiled Android sender. */
|
|
public final class Seal {
|
|
private static byte[] hex(String value) {
|
|
byte[] result = new byte[value.length() / 2];
|
|
for (int i = 0; i < result.length; i++) {
|
|
result[i] = (byte) Integer.parseInt(value.substring(i * 2, i * 2 + 2), 16);
|
|
}
|
|
return result;
|
|
}
|
|
public static void main(String[] args) {
|
|
var sealed = HostedHpkeBackup.INSTANCE.seal(
|
|
hex(args[0]), hex(args[1]), hex(args[2]));
|
|
var base64 = Base64.getUrlEncoder().withoutPadding();
|
|
System.out.println(base64.encodeToString(sealed.get("enc")));
|
|
System.out.println(base64.encodeToString(sealed.get("ciphertext")));
|
|
}
|
|
}
|