{
  "id": "keytool",
  "name": "keytool",
  "homepage": "https://docs.oracle.com/en/java/javase/21/docs/specs/man/keytool.html",
  "description": "A key and certificate management utility that lets users administer their own public/private key pairs and associated certificates.",
  "executables": [
    "keytool"
  ],
  "dotfiles": {
    "paths": [],
    "exclude": [],
    "secret": [
      "~/.keystore"
    ]
  },
  "commands": {
    "format": 1,
    "label": "keytool",
    "description": "List keystore entries and generate key pairs. Passwords are deliberately not fields; keytool prompts for them. Other commands are left out.",
    "quality": "ai-draft",
    "base": "fig:keytool",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": false,
      "short_attached": false,
      "short_bundles": false
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/keytool.ts",
        "license": "MIT"
      }
    ],
    "subcommand": [
      {
        "path": [
          "-list"
        ],
        "label": "List keystore entries",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/keytool.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "keystore",
            "label": "Keystore",
            "type": "path",
            "option": [
              "-keystore"
            ],
            "path": {
              "kind": "file",
              "role": "input"
            },
            "sources": [
              "fig"
            ]
          },
          {
            "id": "alias",
            "label": "Alias",
            "type": "string",
            "option": [
              "-alias"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "cacerts",
            "label": "Use cacerts",
            "type": "boolean",
            "option": [
              "-cacerts"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "verbose",
            "label": "Verbose",
            "type": "boolean",
            "option": [
              "-v"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "rfc",
            "label": "RFC style output",
            "type": "boolean",
            "option": [
              "-rfc"
            ],
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "list",
            "label": "List a keystore",
            "fields": [
              "keystore",
              "verbose"
            ],
            "required": [
              "keystore"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "keystore",
              "alias",
              "cacerts",
              "verbose",
              "rfc"
            ]
          }
        ]
      },
      {
        "path": [
          "-genkeypair"
        ],
        "label": "Generate a key pair",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/keytool.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "alias",
            "label": "Alias",
            "type": "string",
            "option": [
              "-alias"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "keystore",
            "label": "Keystore",
            "type": "path",
            "option": [
              "-keystore"
            ],
            "path": {
              "kind": "file",
              "role": "output",
              "must_exist": false
            },
            "effect": "overwrite",
            "sources": [
              "fig"
            ]
          },
          {
            "id": "keyalg",
            "label": "Key algorithm",
            "type": "string",
            "option": [
              "-keyalg"
            ],
            "suggestions": [
              {
                "value": "RSA",
                "label": "RSA"
              },
              {
                "value": "EC",
                "label": "EC"
              }
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "keysize",
            "label": "Key size (bits)",
            "type": "integer",
            "option": [
              "-keysize"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "validity",
            "label": "Validity (days)",
            "type": "integer",
            "option": [
              "-validity"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "dname",
            "label": "Distinguished name",
            "description": "For example CN=Example, O=Org, C=US.",
            "type": "string",
            "option": [
              "-dname"
            ],
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "rsa",
            "label": "RSA 2048 key pair, one year",
            "set": {
              "keyalg": [
                "RSA"
              ],
              "keysize": [
                2048
              ],
              "validity": [
                365
              ]
            },
            "fields": [
              "alias",
              "keystore",
              "keyalg",
              "keysize",
              "validity",
              "dname"
            ],
            "required": [
              "alias",
              "keystore"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "alias",
              "keystore",
              "keyalg",
              "keysize",
              "validity",
              "dname"
            ]
          }
        ]
      }
    ]
  }
}
