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

decoding EC point format #52

Open
cagney opened this issue Jul 6, 2022 · 2 comments
Open

decoding EC point format #52

cagney opened this issue Jul 6, 2022 · 2 comments

Comments

@cagney
Copy link

cagney commented Jul 6, 2022

In an EC Subject Public Key Info PEM:

-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEU7FK0bi1qUymF77fmVfsUWQzwsWVacE9huKsKRIj7tku/QG7peRfmrvMOLbezIqpnRADROwTXQEgCx2rUjee/Q==
-----END PUBLIC KEY-----

which is for a 256 bit EC, the 520 bit string:

04 53 B1 4A D1 B8
B5 A9 4C A6 17 BE DF 99  57 EC 51 64 33 C2 C5 95
69 C1 3D 86 E2 AC 29 12  23 EE D9 2E FD 01 BB A5
E4 5F 9A BB CC 38 B6 DE  CC 8A A9 9D 10 03 44 EC
13 5D 01 20 0B 1D AB 52  37 9E FD

is made up of a one byte prefix:
04 == EC_POINT_FORM_UNCOMPRESSED
followed by two raw 256 bit EC points.

It would be nice if that, while not ASN.1, was decoded.

(really helpful tool)

@lapo-luchini
Copy link
Owner

I agree it would be nice… but it potentially open up a can of worms I'm not sure I have time to maintain (as in: if this very specific decoding is added, how many other should/could be added?).
I'll think about it. 🤔
(thanks!)

@lapo-luchini
Copy link
Owner

This is similar to not being able to detect types of a PKCS#1 embedded in a PKCS#8 as in #76 but potentially more complex because the content is not even ASN.1.
But in that case at least the PKCS#8 contains an OID that uniquely identifies the content type (and a plugin system could for example theoretically support that) while for this raw value, which is not even ASN.1 itself… I'm not sure there's any sensible way to do it in a generic way, seems kinda out of scope.

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

3 participants
@cagney @lapo-luchini and others