-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Updated Paserk Local, Public & Secret and added Lid, Pid, Sid #88
Updated Paserk Local, Public & Secret and added Lid, Pid, Sid #88
Conversation
…ept PaserkItemTest parameter
Wow, that was a huge contribution! Thanks a lot! Regarding the
Source: command line tool to export RSA private key to RSAPublicKey So based on that, it seems to be safe to append the algorithm identifier.
Don't worry, we all have been there. I've learned quite a lot while working in Paseto and NaCl.Core (the library which supports XChaCha20-Poly1305 when there wasn't a .NET implementation). I've found this information really interesting regarding the two public key formats, you might want to check it out: https://stackoverflow.com/a/29707204 |
When you update your PR, can you update the README file to match the supported Paserk extensions? |
Codecov Report
@@ Coverage Diff @@
## master #88 +/- ##
==========================================
- Coverage 82.62% 82.45% -0.17%
==========================================
Files 104 105 +1
Lines 5295 5387 +92
Branches 327 344 +17
==========================================
+ Hits 4375 4442 +67
- Misses 798 815 +17
- Partials 122 130 +8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Encode
Note that 51/52 47/48 tests pass for
TypesTestVectors
andTestIdVectors
. The 2 fails are because V1 public key does not encode correctly. The test expects an ASN1 encoded PKCS#1 object identifier to be appended to the front of the key. Updating V1 encode/decode to append/removeMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
might fix the problem. - This seems a little hacky and I don't know enough about ASN1 to be sure so I held off.TODO
PaserkHelper
could probably do with a refactor, I feel like I'm abusing switch expressions and generators 😆PasetoKey
and its derivatives validate the keys they are constructed with? A length check/type check could be added to each key constructor to reject incorrect keys.