saifi009 / bitcoinj

Automatically exported from code.google.com/p/bitcoinj
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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/1d1f32699c4d554ed66c33f1cc38d0fd1e
aeeed5

I have submitted the electronic version of your CLA.

Original issue reported on code.google.com by thilopl...@googlemail.com on 31 Mar 2011 at 1:07

GoogleCodeExporter commented 9 years ago
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.

Original comment by hearn@google.com on 31 Mar 2011 at 1:21

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r51.

Original comment by hearn@google.com on 31 Mar 2011 at 8:38