Documentation
¶
Index ¶
Constants ¶
const ( DefaultRetries = 1 DefaultTimeout = 0 DefaultThreads = 0 DefaultDryRun = false )
Service manager configuration constants
const ( PrivateKeyPermissions = 0600 PublicKeyPermissions = 0644 DirectoryPermissions = 0755 )
File permission constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyPairCommand ¶
type KeyPairCommand struct {
// contains filtered or unexported fields
}
KeyPairCommand represents a command for generating ECDSA P-256 key pairs for evidence signing. It handles key generation, file management, and optional upload to JFrog platform trusted keys.
func NewGenerateKeyPairCommand ¶
func NewGenerateKeyPairCommand(serverDetails *config.ServerDetails, uploadPublicKey bool, keyAlias string, keyFilePath string, keyFileName string) *KeyPairCommand
NewGenerateKeyPairCommand creates a new KeyPairCommand instance with the provided configuration. Parameters:
- serverDetails: JFrog platform connection details (required for trusted keys upload)
- uploadPublicKey: whether to upload the generated public key to trusted keys
- keyAlias: custom alias for the key (empty for auto-generated timestamp-based alias)
- keyFilePath: directory to save key files (empty for current directory)
- keyFileName: base name for key files (empty for default "evidence")
func (*KeyPairCommand) CommandName ¶
func (cmd *KeyPairCommand) CommandName() string
CommandName returns the command name for error handling and logging purposes.
func (*KeyPairCommand) Run ¶
func (cmd *KeyPairCommand) Run() error
Run executes the complete key pair generation workflow. It generates ECDSA P-256 keys, saves them to files with proper permissions, and optionally uploads the public key to JFrog platform trusted keys. Returns an error if any step fails.
func (*KeyPairCommand) UploadTrustedKey ¶
func (cmd *KeyPairCommand) UploadTrustedKey(serviceManager *artifactory.ArtifactoryServicesManager, alias, publicKey string) (*services.TrustedKeyResponse, error)
UploadTrustedKey uploads a public key to the JFrog trusted keys API using the ArtifactoryServicesManager. Validates input parameters and creates TrustedKeyParams for the upload operation.