/** * Parse a DER-encoded data structure by calling registered handlers when points of interest are encountered in the * parse tree. * * @param encoded DER-encoded bytes. */ public void parse(final ByteBuffer encoded) { parseTags(encoded); }
/** * Parse a DER-encoded data structure by calling registered handlers when points of interest are encountered in the * parse tree. * * @param encoded DER-encoded bytes. */ public void parse(final ByteBuffer encoded) { parseTags(encoded); }
/** * Parse a DER-encoded data structure by calling registered handlers when points of interest are encountered in the * parse tree. * * @param encoded DER-encoded bytes. */ public void parse(final ByteBuffer encoded) { parseTags(encoded); }
/** * Invokes the parse handler for the current path and advances to the next position in the encoded bytes. * * @param tag to inspect for internal tags * @param encoded to parse */ private void parseTag(final DERTag tag, final ByteBuffer encoded) { final int end = readLength(encoded) + encoded.position(); final int start = encoded.position(); // Invoke handlers for all permutations of current path ParseHandler handler; for (DERPath p : permutations) { handler = handlerMap.get(p); if (handler != null) { encoded.position(start).limit(end); handler.handle(this, encoded); } } if (tag.isConstructed()) { parseTags(encoded); } encoded.position(end).limit(encoded.capacity()); }
/** * Invokes the parse handler for the current path and advances to the next position in the encoded bytes. * * @param tag to inspect for internal tags * @param encoded to parse */ private void parseTag(final DERTag tag, final ByteBuffer encoded) { final int limit = encoded.limit(); final int end = readLength(encoded) + encoded.position(); final int start = encoded.position(); // Invoke handlers for all permutations of current path ParseHandler handler; for (DERPath p : permutations) { handler = handlerMap.get(p); if (handler != null) { encoded.position(start).limit(end); handler.handle(this, encoded); } } if (tag.isConstructed()) { parseTags(encoded); } encoded.limit(limit).position(end); }
/** * Invokes the parse handler for the current path and advances to the next position in the encoded bytes. * * @param tag to inspect for internal tags * @param encoded to parse */ private void parseTag(final DERTag tag, final ByteBuffer encoded) { final int limit = encoded.limit(); final int end = readLength(encoded) + encoded.position(); final int start = encoded.position(); // Invoke handlers for all permutations of current path ParseHandler handler; for (DERPath p : permutations) { handler = handlerMap.get(p); if (handler != null) { encoded.position(start).limit(end); handler.handle(this, encoded); } } if (tag.isConstructed()) { parseTags(encoded); } encoded.limit(limit).position(end); }