tink icon indicating copy to clipboard operation
tink copied to clipboard

Reading keyset using javascript

Open jyzhe opened this issue 5 years ago • 1 comments

Hi,

I was playing around with tink-crypto from npm for javascript and i wanted to do something like KeysetHandle.readNoSecret(JsonKeysetReader.withString(json)).getPrimitive(HybridEncrypt). I have the required json object but I wasn't able to find the javascript version of the JsonKeysetReader. What would be the best alternative for my use case?

Thanks

jyzhe avatar Oct 26 '20 19:10 jyzhe

We don't currently offer JSON-based keysets in JavaScript because the underlying JavaScript protobuf implementation doesn't support JSON serialization. A feature request for this could be opened, but it's a bit complicated because it raises questions about the relationship between Tink and protobuf in JavaScript (which is already the source of a lot of friction).

Where are you getting json from? Would it work to have that system give you the keyset in binary protobuf format instead? That's the only format currently supported by Tink in JS.

taymonbeal avatar Oct 26 '20 20:10 taymonbeal

As the above comment remains unanswered, I will close this.

tholenst avatar Jan 26 '23 16:01 tholenst