{"record":{"id":"cb6393627b096a67","repo":"eclipse-vertx/vert.x","slug":"missing-private-key-path","errorCode":null,"errorMessage":"Missing private key path","messagePattern":"Missing private key path","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/net/impl/KeyStoreHelper.java","lineNumber":287,"sourceCode":"      throw new VertxException(\"Missing private key\");\n    } else if (keyValue.size() > certValue.size()) {\n      throw new VertxException(\"Missing X.509 certificate\");\n    }\n    final KeyStore keyStore = createEmptyKeyStore();\n    Iterator<Buffer> keyValueIt = keyValue.iterator();\n    Iterator<Buffer> certValueIt = certValue.iterator();\n    int index = 0;\n    while (keyValueIt.hasNext() && certValueIt.hasNext()) {\n      PrivateKey key = loadPrivateKey(keyValueIt.next());\n      Certificate[] chain = loadCerts(certValueIt.next());\n      keyStore.setEntry(\"dummy-entry-\" + index++, new KeyStore.PrivateKeyEntry(key, chain), new KeyStore.PasswordProtection(DUMMY_PASSWORD.toCharArray()));\n    }\n    return keyStore;\n  }\n\n  private static PrivateKey loadPrivateKey(Buffer keyValue) throws Exception {\n    if (keyValue == null) {\n      throw new RuntimeException(\"Missing private key path\");\n    }\n    KeyFactory rsaKeyFactory = KeyFactory.getInstance(\"RSA\");\n    KeyFactory ecKeyFactory = getECKeyFactory();\n    List<PrivateKey> pems = loadPems(keyValue, (delimiter, content) -> {\n      try {\n        switch (delimiter) {\n          case \"EC PRIVATE KEY\":\n            if (ecKeyFactory == null) {\n              // ECC is not supported by JVM\n              return Collections.emptyList();\n            } else {\n              // read PEM file as described in https://datatracker.ietf.org/doc/html/rfc5915#section-4\n              return Collections.singletonList(ecKeyFactory.generatePrivate(PrivateKeyParser.getECKeySpec(content)));\n            }\n          case \"RSA PRIVATE KEY\":\n            return Collections.singletonList(rsaKeyFactory.generatePrivate(PrivateKeyParser.getRSAKeySpec(content)));\n          case \"PRIVATE KEY\":\n            // in PKCS#8 the key algorithm is indicated at the beginning of the ASN.1 structure","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/net/impl/KeyStoreHelper.java#L269-L305","documentation":"PEM parsing failure in the private-key loading path (loadPrivateKey): an IOException occurred while reading the private key file backing the buffer, e.g. the configured key path does not exist or is unreadable. The message is a path-error sentinel; the input at fault is the private key path/value configured in PemKeyCertOptions.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/net/impl/KeyStoreHelper.java:287 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the private key path exists and is readable","Check that the configured value is a valid PEM private key"],"exampleFix":null,"handlingStrategy":"try-catch","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-14T00:17:10.932Z"}