Class ExportKeyringSecretCommand

java.lang.Object
org.egothor.methodatlas.evidence.ExportKeyringSecretCommand

public final class ExportKeyringSecretCommand extends Object
CLI command handler for the -export-keyring-secret mode, which prints an encrypted keyring as a single text value for a CI/CD platform secret.

Usage

methodatlas -export-keyring-secret <keyring-file> > keyring.secret

The output is the keyring bundle described in KeyringFiles: the encrypted store and its .nonce sidecar, Base64-encoded under a header line. It is consumed by -evidence-pack-keyring-env. The keyring stays encrypted inside the bundle, so no password is needed to export it and the password must be stored as a separate secret. The bundle is printed to stdout; guidance goes to stderr so redirection captures only the secret.

Since:
6.2.0
See Also:
  • KeyringFiles.exportBundle(Path)
  • Field Details

    • FLAG_EXPORT_KEYRING_SECRET

      public static final String FLAG_EXPORT_KEYRING_SECRET
      Mode flag that selects this command.
      See Also:
  • Method Details

    • run

      public static int run(String[] args, PrintWriter out) throws IOException
      Parses -export-keyring-secret arguments and prints the bundle.
      Parameters:
      args - full command-line arguments, including the mode flag and its value
      out - writer that receives the bundle text
      Returns:
      0 on success, 2 when the keyring argument is missing
      Throws:
      IOException - if the keyring cannot be read or is not an encrypted keyring