From b93638b6935e7fb179385cd38a1691372b4c8432 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 17 Dec 2015 13:30:34 +0100 Subject: Add types, simplify balance display. --- extension/background/emscriptif.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'extension/background/emscriptif.ts') diff --git a/extension/background/emscriptif.ts b/extension/background/emscriptif.ts index 150b68741..f21e60db4 100644 --- a/extension/background/emscriptif.ts +++ b/extension/background/emscriptif.ts @@ -416,12 +416,20 @@ class EddsaPublicKey extends PackedArenaObject { } + class RsaBlindingKey extends ArenaObject { static create(len: number, a?: Arena) { let o = new RsaBlindingKey(a); o.nativePtr = emscAlloc.rsa_blinding_key_create(len); return o; } + static fromCrock(s: string, a?: Arena): RsaBlindingKey { + let obj = new this(a); + let buf = ByteArray.fromCrock(s); + obj.setNative(emscAlloc.rsa_blinding_key_decode(buf.getNative(), buf.size())); + buf.destroy(); + return obj; + } toCrock(): string { let ptr = emscAlloc.malloc(PTR_SIZE); -- cgit v1.2.3