mirror of
https://github.com/block/buzz.git
synced 2026-11-25 18:52:52 +00:00
feat(mobile): extend key recovery and community onboarding
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>
This commit is contained in:
20
mobile/tool/hpke_android/Seal.java
Normal file
20
mobile/tool/hpke_android/Seal.java
Normal file
@@ -0,0 +1,20 @@
|
||||
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")));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user