-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd: support private keys in
kes identity
This commit is part of the CLI refactoring https://github.com/minio/kes/milestone/6 This commit adds support for parsing PEM private key files and printing their private key as API key. Now, the `kes identity` command is now able to generate API keys, print identities of API keys or certificates and convert private key files to API keys. The existing sub-commands `new`, `of`, `info` `ls` are still supported. As of now, only private keys of type Ed25519 are supported. Signed-off-by: Andreas Auernhammer <github@aead.dev>
- Loading branch information
Showing
6 changed files
with
180 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2024 - MinIO, Inc. All rights reserved. | ||
// Use of this source code is governed by the AGPLv3 | ||
// license that can be found in the LICENSE file. | ||
|
||
package cli | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
tui "github.com/charmbracelet/lipgloss" | ||
) | ||
|
||
// Exit prints args as error message and aborts with exit code 1. | ||
func Exit(args ...any) { | ||
const FG tui.Color = "#ac0000" | ||
s := tui.NewStyle().Foreground(FG).Render("Error: ") | ||
|
||
fmt.Fprintln(os.Stderr, s+fmt.Sprint(args...)) | ||
os.Exit(1) | ||
} | ||
|
||
// Exitf formats args as error message and aborts with exit code 1. | ||
func Exitf(format string, args ...any) { | ||
const FG tui.Color = "#ac0000" | ||
s := tui.NewStyle().Foreground(FG).Render("Error: ") | ||
|
||
fmt.Fprintln(os.Stderr, s+fmt.Sprintf(format, args...)) | ||
os.Exit(1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.