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

issue on ECKey instantiation #8

Closed
secioss-git opened this issue Jan 16, 2019 · 4 comments
Closed

issue on ECKey instantiation #8

secioss-git opened this issue Jan 16, 2019 · 4 comments

Comments

@secioss-git
Copy link

When using Prime 256 key the length of x and y should both be 32 byte.
but when dump key object, i got 31 and 33 byte of x and y.

Sample dump is here
object(SimpleJWT\Keys\ECKey)#1 (1) {
["data":protected]=>
array(6) {
["kty"]=>
string(2) "EC"
["crv"]=>
string(5) "P-256"
["d"]=>
string(43) "MCLUMijLCR8uuVrjgZxaMWtHnElEPhewa1vLEouThZc"
["x"]=>
string(42) "7ctn9jXL_oYnSE_jwiDyI3mxEy4s2CxbIYB_i5tmSg"
["y"]=>
string(44) "zuUFbsHCKVZhZ13IZMluI0lDXhzQkNy7MO-cYK7sWdiK"
["kid"]=>
string(6) "example"
}
}

@kelvinmo
Copy link
Owner

Would you be able to send through the PEM form of this key?

@secioss-git
Copy link
Author

Here is the pem file.

-----BEGIN EC PARAMETERS-----
BggqhkjOPQMBBw==
-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIDAi1DIoywkfLrla44GcWjFrR5xJRD4XsGtbyxKLk4WXoAoGCCqGSM49
AwEHoUQDQgAE7ctn9jXL/oYnSE/jwiDyI3mxEy4s2CxbIYB/i5tmSs7lBW7BwilW
YWddyGTJbiNJQ14c0JDcuzDvnGCu7FnYig==
-----END EC PRIVATE KEY-----

@kelvinmo
Copy link
Owner

This should be fixed in 18943a6

@secioss-git
Copy link
Author

The fix works fine. Thank you very much.

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