{"record":{"id":"1f7965d61e2c899a","repo":"eclipse-vertx/vert.x","slug":"invalid-der-can-t-handle-ucs-4-string","errorCode":null,"errorMessage":"Invalid DER: can't handle UCS-4 string","messagePattern":"Invalid DER: can't handle UCS-4 string","errorType":"exception","errorClass":"VertxException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/net/impl/pkcs1/PrivateKeyParser.java","lineNumber":513,"sourceCode":"        case DerParser.PRINTABLE_STRING:\n        case DerParser.VIDEOTEX_STRING:\n        case DerParser.IA5_STRING:\n        case DerParser.GRAPHIC_STRING:\n        case DerParser.ISO646_STRING:\n        case DerParser.GENERAL_STRING:\n          encoding = \"ISO-8859-1\";\n          break;\n\n        case DerParser.BMP_STRING:\n          encoding = \"UTF-16BE\";\n          break;\n\n        case DerParser.UTF8_STRING:\n          encoding = \"UTF-8\";\n          break;\n\n        case DerParser.UNIVERSAL_STRING:\n          throw new VertxException(\"Invalid DER: can't handle UCS-4 string\");\n\n        default:\n          throw new VertxException(\"Invalid DER: object is not a string\");\n      }\n\n      try {\n        return new String(value, encoding);\n      } catch (UnsupportedEncodingException e) {\n        throw new VertxException(e);\n      }\n    }\n  }\n}\n","sourceCodeStart":495,"sourceCodeEnd":527,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/net/impl/pkcs1/PrivateKeyParser.java#L495-L527","documentation":"DER parsing limitation in PrivateKeyParser.getString: the string element uses ASN.1 UNIVERSAL_STRING (UCS-4), which this parser does not decode. The input at fault is the DER string element inside the parsed key/structure; such encodings are rare in key files.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/net/impl/pkcs1/PrivateKeyParser.java:513 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-encode the key using UTF8String/PrintableString elements","Use a key produced by mainstream tooling (OpenSSL/JDK)"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}