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

Support Ed25519 #45

Open
JamesTheAwesomeDude opened this issue Jan 23, 2019 · 2 comments
Open

Support Ed25519 #45

JamesTheAwesomeDude opened this issue Jan 23, 2019 · 2 comments
Labels
priority: unplanned Work that we believe should be done, but does not have a higher priority.

Comments

@JamesTheAwesomeDude
Copy link

In preparation for this, can we get support for those keys?

Doesn't seem to be present in 1.1.0:

$ python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from cryptography.hazmat.backends import default_backend
>>> from cryptography.hazmat.primitives import serialization
>>> from cryptography.hazmat.primitives.asymmetric import rsa,x25519
>>> from josepy import jwk
>>> jwk.JWK.load(
...     rsa.generate_private_key(
...      public_exponent=0xFFFF+2,
...      key_size=2048,
...      backend=default_backend()
...     ).private_bytes(
...      encoding=serialization.Encoding.PEM,
...      format=serialization.PrivateFormat.PKCS8,
...      encryption_algorithm=serialization.NoEncryption()
...     )
... )
JWKRSA(key=<ComparableRSAKey(<cryptography.hazmat.backends.openssl.rsa._RSAPrivateKey object at 0xffff90832080>)>)
>>> jwk.JWK.load(
...     x25519.X25519PrivateKey.generate(
...     ).private_bytes(
...      encoding=serialization.Encoding.PEM,
...      format=serialization.PrivateFormat.PKCS8,
...      encryption_algorithm=serialization.NoEncryption()
...     )
... )
Traceback (most recent call last):
  File "<stdin>", line 6, in <module>
  File "/home/james/.local/lib/python3.6/site-packages/josepy/jwk.py", line 120, in load
    raise errors.Error('Unsupported algorithm: {0}'.format(key.__class__))
josepy.errors.Error: Unsupported algorithm: <class 'cryptography.hazmat.backends.openssl.x25519._X25519PrivateKey'>
>>>

(Yes I know there are shortcuts for the RSA keygen but I'm doing the verbose form to show exact comparability in the generation)

@bmw
Copy link
Member

bmw commented Jan 24, 2019

Getting support added would be great!

I think there may have been some progress made in #8, however, the PR hasn't been updated in quite a while. If anyone is interested in continuing this work, we'd love to see a PR!

@bmw bmw added the priority: unplanned Work that we believe should be done, but does not have a higher priority. label Mar 25, 2020
@atombrella
Copy link
Contributor

There are details in this RFC https://tools.ietf.org/html/rfc8037

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: unplanned Work that we believe should be done, but does not have a higher priority.
Projects
None yet
Development

No branches or pull requests

3 participants