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

Patch to add ECKey#toASN1 to convert it back into the standard format #374

Closed
mikehearn opened this issue Jun 11, 2015 · 2 comments
Closed
Labels
Enhancement Request for enhancement, or the implementation of one

Comments

@mikehearn
Copy link
Member

Originally reported on Google Code with ID 8

This patch adds a toASN1 method to go along with ECKey#fromASN1.

The produced byte sequence is not identical, it is longer, because of the way BountyCastle
adds padding to the eliptic curve parameters.
But the attached unit test confirms that it can be read again and produces the same
key.

I planned to use this instead of Object serialization, but it seems that the ASN1 is
actually longer than the Java serialization, because it also includes the curve description,
which the code assumes to be fixed.

https://github.com/thiloplanz/bitcoinj/commit/1d1f32699c4d554ed66c33f1cc38d0fd1eaeeed5

I have submitted the electronic version of your CLA.

Reported by thiloplanz on 2011-03-31 13:07:44

@mikehearn mikehearn added Enhancement Request for enhancement, or the implementation of one Priority-Medium labels Jun 11, 2015
@mikehearn
Copy link
Member Author

Brilliant, thanks. The change looks great. I will try and merge this in today. If I
don't it'll have to wait a week as tomorrow I'm off on vacation.

Reported by hearn@google.com on 2011-03-31 13:21:53

  • Labels added: Type-Enhancement
  • Labels removed: Type-Defect

@mikehearn
Copy link
Member Author

This issue was closed by revision r51.

Reported by hearn@google.com on 2011-03-31 20:38:40

  • Status changed: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Request for enhancement, or the implementation of one
Projects
None yet
Development

No branches or pull requests

1 participant