-
Notifications
You must be signed in to change notification settings - Fork 263
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
[ELY-125] Add a DER encoder and decoder #84
Conversation
* | ||
* @author <a href="mailto:fjuma@redhat.com">Farah Juma</a> | ||
*/ | ||
public class PosByteArrayInputStream extends ByteArrayInputStream { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use ByteIterator instead (see #81) once that's all merged and sorted out. Then you can also get rid of all the IOException which might make things simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point, I'll do that.
This looks good but it needs rebasing now that #81 has been merged |
Rebased and updated DERDecoder so that it uses ByteIterator instead of ByteArrayInputStream. |
public class DERDecoder implements ASN1Decoder { | ||
|
||
private ByteIterator bi; | ||
private LinkedList<DecoderState> states = new LinkedList<DecoderState>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could probably be an ArrayDeque instead, which also implements the stack contract but is much more memory performant.
Looks great other than (very) minor notes. |
Reviewed, looks good. |
Updated to use an ArrayDeque for the states in DEREncoder and DERDecoder. |
[ELY-125] Add a DER encoder and decoder
Masked Password related changes
https://issues.jboss.org/browse/ELY-125