wstrange / asn1lib

Dart ASN1 Encoder / Decoder
BSD 2-Clause "Simplified" License
30 stars 30 forks source link

PEM PKCS#8 private key unit test #17

Closed areiter closed 8 years ago

areiter commented 8 years ago

Just in case someone else needs it, I added the extraction of parameters for a PKCS#8 encoded private key.

stevenroose commented 8 years ago

Personally, I'd make the contentBytes() function a getter instead of a function.

But otherwise, good PR! Always nice to have extra tests! :)

areiter commented 8 years ago

I used a method because valueBytes() is also a method. But a getter seems to be a cleaner approach :-)

stevenroose commented 8 years ago

On the other hand, a getter would be inconsistent with the already existing valueBytes(). So I guess this is fine.

I'll take a second look and run the tests when I'm on my computer. Thanks for the PR!

stevenroose commented 8 years ago

Hah, you got me there.

Well, if we change both, we break compatibility, so that's maybe something for if we would change the whole interface. Nothing for the foreseeable future. So leave it as a method, it's fine.

stevenroose commented 8 years ago

Uhm, just wanted to merge this, but you seem to have pushed another change onto the branch. Can you set the branch one commit back and create a new PR for the other change?

(Also, it seems to me you forgot the encodeInteger method in that new commit.)

areiter commented 8 years ago

Sorry, follow-up #19