Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to implement something alike the Azure Key Vault wrapKey function using this library? #131

Closed
rgl opened this issue Aug 10, 2020 · 1 comment

Comments

@rgl
Copy link

rgl commented Aug 10, 2020

Is there a way to implement something like Azure Key Vault wrapKey function using this library?

Essentially, in azure key vault I create a RSA key-pair then invoke the wrapKey function alike:

keyID, wrappedKey = azureKeyVault.wrapKey(keyName, "RSA-OAEP-256", key)

Where key is the plaintext (as a []byte) that we want to encrypt with the named keyName RSA public-key that is stored in azure key vault. And wrappedKey is the returned ciphertext that was encrypted with the RSA public-key.

I've tried to follow #94 but I'm still not seeing a way to implement this... maybe pkcs11.Ctx.WrapKey is not really equivalent to the Azure wrapKey function and what I really want to use is pkcs11.Ctx.Encrypt? if so, do you concur that the following is the way to implement this?

https://github.com/ThalesIgnite/crypto11/blob/3d83a0a5d480dbbc8a65be3a111e194b5275e58b/rsa_test.go#L204-L232

@miekg miekg closed this as completed Jan 4, 2022
@rgl
Copy link
Author

rgl commented Jan 4, 2022

@miekg, can you please comment why you've closed this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants