@Override
    public int invoke(ToolInvocation invocation) {
        var arguments    = invocation.arguments();
        var leftoverArgs = arguments.getArgs();
        if (leftoverArgs.length != 1) {
            throw new IllegalArgumentException("Expected exactly 1 token string argument");
        }
        var token = SealedSharedKey.fromTokenString(leftoverArgs[0]);
        var stdOut = invocation.stdOut();

        stdOut.format("Version:         %d\n", token.tokenVersion());
        stdOut.format("Key ID:          %s (%s)\n", StringUtilities.escape(token.keyId().asString()), hex(token.keyId().asBytes()));
        stdOut.format("HPKE enc:        %s\n", hex(token.enc()));
        stdOut.format("HPKE ciphertext: %s\n", hex(token.ciphertext()));

        return 0;
    }
Tooling to dump the various components of a decryption token

@author vekterli
vespaclient-java/src/main/java/com/yahoo/vespa/security/tool/crypto/TokenInfoTool.java