class DERPath {

  static Node toNode(final String node)
  {
    final Matcher matcher = NODE_PATTERN.matcher(node);
    if (!matcher.matches()) {
      throw new IllegalArgumentException("Invalid node: " + node);
    }

    final String name = matcher.group(1);
    final String index = matcher.group(2);
    if (index != null) {
      return new Node(name, Integer.parseInt(index));
    }
    return new Node(name);
  }

  public  DERPath();
  public  DERPath(final DERPath path);
  public  DERPath(final String pathSpec);

}