{"record":{"id":"94fd2c090736995c","repo":"eclipse-vertx/vert.x","slug":"keystore-does-not-contains-a-valid-entry","errorCode":null,"errorMessage":"KeyStore does not contains a valid entry","messagePattern":"KeyStore does not contains a valid entry","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/net/impl/quic/TokenManager.java","lineNumber":100,"sourceCode":"      if (aliases.hasMoreElements()) {\n        entry = keystore.getEntry(aliases.nextElement(), new KeyStore.PasswordProtection(keyStoreOptions.getPassword().toCharArray()));\n      }\n    } else if (conf instanceof PemKeyCertOptions) {\n      PemKeyCertOptions pemKeyCertOptions = (PemKeyCertOptions) conf;\n      KeyStoreHelper helper = pemKeyCertOptions.getHelper(vertx);\n      KeyStore keystore = helper.store();\n      Enumeration<String> aliases = keystore.aliases();\n      if (aliases.hasMoreElements()) {\n        entry = keystore.getEntry(aliases.nextElement(), new KeyStore.PasswordProtection(KeyStoreHelper.DUMMY_PASSWORD.toCharArray()));\n      }\n    } else {\n      throw new IllegalArgumentException(\"Invalid configuration\");\n    }\n    if (entry != null) {\n      signingAlgorithm = SigningAlgorithm.create(entry);\n      length = signingAlgorithm.signer().sign(new byte[0]).length;\n    } else {\n      throw new IllegalArgumentException(\"KeyStore does not contains a valid entry\");\n    }\n  }\n\n  public SigningAlgorithm signingAlgorithm() {\n    return signingAlgorithm;\n  }\n\n  public byte[] generateToken(byte[] payload) {\n    ByteBuf out = Unpooled.buffer();\n    writeToken(out, Unpooled.copiedBuffer(payload), new InetSocketAddress(NetUtil.LOCALHOST4, 8080));\n    return ByteBufUtil.getBytes(out);\n  }\n\n  public boolean verify(byte[] token) throws Exception {\n    return validateToken(Unpooled.copiedBuffer(token), new InetSocketAddress(NetUtil.LOCALHOST4, 8080)) >= 0;\n  }\n\n  private static byte[] basePayload(InetSocketAddress address, ByteBuf dcid) {","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/net/impl/quic/TokenManager.java#L82-L118","documentation":"Initialization failure in TokenManager.init: the resolved keystore contains no usable entry for token signing (no aliases present, or the first entry is not a valid key entry). The message is a sentinel for an empty/invalid keystore; the input at fault is the keystore configured for QUIC address-validation tokens.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/net/impl/quic/TokenManager.java:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Populate the keystore with at least one valid key entry","Verify the keystore password and type configuration"],"exampleFix":null,"handlingStrategy":"validation","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"}