eclipse-vertx/vert.x · error · VertxException

Invalid DER: object is not a string

Error message

Invalid DER: object is not a string

What it means

DER structure mismatch in PrivateKeyParser.getString: the element's ASN.1 tag matches none of the supported string types (UTF8, Printable, IA5, BMP, etc.). The input at fault is the DER element being read; typically means the structure is not a string where one was expected (malformed key).

Source

Thrown at vertx-core/src/main/java/io/vertx/core/net/impl/pkcs1/PrivateKeyParser.java:516

        case DerParser.GRAPHIC_STRING:
        case DerParser.ISO646_STRING:
        case DerParser.GENERAL_STRING:
          encoding = "ISO-8859-1";
          break;

        case DerParser.BMP_STRING:
          encoding = "UTF-16BE";
          break;

        case DerParser.UTF8_STRING:
          encoding = "UTF-8";
          break;

        case DerParser.UNIVERSAL_STRING:
          throw new VertxException("Invalid DER: can't handle UCS-4 string");

        default:
          throw new VertxException("Invalid DER: object is not a string");
      }

      try {
        return new String(value, encoding);
      } catch (UnsupportedEncodingException e) {
        throw new VertxException(e);
      }
    }
  }
}

View on GitHub (pinned to fb308bd8c3)

Solutions

  1. Re-export the key in a well-formed supported format
  2. Validate the PEM/DER input before configuring it
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at vertx-core/src/main/java/io/vertx/core/net/impl/pkcs1/PrivateKeyParser.java:516 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of eclipse-vertx/vert.x@fb308bd8c3 (2026-09-06). Data as JSON: /api/errors/f5b918fd67c1cb39. Report an issue: GitHub.