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

Signatory-cli import on azure - error: The property "key" must be a valid JsonWebKey object #231

Open
colossus-digital opened this issue Jul 28, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@colossus-digital
Copy link

I cannot import an spsk private key (secp256k1) on azure key vault. The result is: Error: The property "key" must be a valid JsonWebKey object.
Any solution / workaround ?

tnks

image

@AbineshECAD
Copy link
Contributor

I'm looking into this now and will update ASAP.

@AbineshECAD
Copy link
Contributor

AbineshECAD commented Jul 29, 2022

I got the issue reproduced. I'm still debugging, will update once I get a workaround or fix.

% ./signatory-cli import -c ./azure.yaml --base-dir ./ --vault azure spsk
INFO[0000] Initializing vault vault=azure vault_name=azure INFO[0000] Requesting import operation pkh=tz2PeYw5zJS3Q2aXd2zuQbjs4MTbwmvCQ6tg vault=Azure vault_name="https://forimport.vault.azure.net/" Error: (Azure/https://forimport.vault.azure.net/): The property "key" must be a valid JsonWebKey object.

@AbineshECAD
Copy link
Contributor

AbineshECAD commented Jul 29, 2022

Found the cause of the issue. For p256k alone "curve:" parameter is empty when filling in the fields of the key in JWK format. It is filled with the return value of key.Params().Name
Once I fill in the curve parameter statically when key.Params().Name is empty the import succeeds without any issue.

Code:

j.Curve = key.Params().Name

If you are building signatory from the source you can add the workaround here for now.
j.Curve = key.Params().Name
if j.Curve == "" {
j.Curve = "P-256K"
}

For the fix, I have to figure out things as the crypto library doesn't support this curve yet.

@jevonearth jevonearth added the bug Something isn't working label Oct 19, 2022
@jevonearth
Copy link
Contributor

Fixed in #256, @AbineshECAD to verify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

4 participants