Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Tink javascript-typescript missing the getPublicKeysetHandle function #489

Closed
Generic35 opened this issue Apr 14, 2021 · 2 comments
Closed
Assignees

Comments

@Generic35
Copy link

Generic35 commented Apr 14, 2021

Is your feature request related to a problem?

Not sure if it's a missing feature or a bug.

The javascript/typescript version of tink, for the Hybrid encryption primitive, does not have a getPublicKeysetHandle function available.

The tink documentation suggests to refer to the Java documentation and example.
I am following this Java, Hybrid encryption example, I found all the corresponding methods in the Javascript/typescript tink library, except the getPublicKeysetHandle of this example.

Is there an equivalent way to obtain the public keyset handle in the javascript/typescript tink library?

Describe the solution you'd like

I need a way to obtain the public keyset from the private keyset handle, to then get the hybrid encryption primitive like in this example: https://github.com/google/tink/blob/master/docs/JAVA-HOWTO.md#hybrid-encryption

For example, if i try to use it as so:

 tink.hybrid.register(); 
 privateKeysetHandle = await tink.generateNewKeysetHandle(
          tink.hybrid.eciesP256HkdfHmacSha256Aes128GcmKeyTemplate()
        );
 const primitiveSet = await privateKeysetHandle.getPrimitive<tink.hybrid.HybridEncrypt>(
          tink.hybrid.HybridEncrypt
        );

I get this error:
>>> error encrypting/decrypting SecurityException: Requested primitive type which is not supported by this key manager.

Looking at the java example I mentioned in introduction, getPrimitive for encryption is expecting the public key, and is obtained from the private key. Looking at the code from where the exception is thrown also rhymes with this.

Finally, the same get primitive call for Decrypting works just fine, so does not throw an error.

But I do need the public key, for encrypting.

@Generic35 Generic35 changed the title Tink javascript/typescript missing getPublicKeysetHandle funtion Tink javascript-typescript missing the getPublicKeysetHandle function Apr 14, 2021
@GuillaumeVachon
Copy link

Hi, I was wondering if there is any update on this issue and or if there is a alternative meanwhile?

@tholenst tholenst assigned ioannanedelcu and unassigned thaidn and chuckx Jan 26, 2023
@juergw
Copy link
Contributor

juergw commented May 17, 2023

We intent to Remove Tink for JavaScript/TypeScript, see #689.

So I will close this.

@juergw juergw closed this as completed May 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants