Skip to content

Commit

Permalink
feat: Show x509 signature algorithm.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-lobocki committed Oct 24, 2024
1 parent 0969c0c commit f8c8a28
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 17 deletions.
15 changes: 15 additions & 0 deletions cmd/columns_x509certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func getX509Columns() []tX509Column {
titleColor: color.Bold,

contentSource: func(x tX509CertificateProvisionerRevocation, _ tConfig) string {
// return x.X509Certificate.SignatureAlgorithm.String()
return x.X509Certificate.Subject.String()
},

Expand Down Expand Up @@ -160,6 +161,20 @@ func getX509Columns() []tX509Column {
contentEscapeMD: true,
},

tX509Column{
isShown: func(tc tConfig) bool { return tc.showSignatureAlgorithm },
title: func() string { return "Algorithm" }, // Static title.
titleColor: color.Bold,

contentSource: func(x tX509CertificateProvisionerRevocation, _ tConfig) string {
return x.X509Certificate.SignatureAlgorithm.String()
},

contentColor: func(_ tX509CertificateProvisionerRevocation) color.Attribute { return color.FgWhite }, // Static color.
contentAlignMD: ALIGN_LEFT,
contentEscapeMD: true,
},

tX509Column{
isShown: func(_ tConfig) bool { return true }, // Always shown.
title: func() string { return "Start" }, // Static title.
Expand Down
1 change: 1 addition & 0 deletions cmd/command_x509certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func init() {
x509certsCmd.Flags().BoolVar(&config.showIssuer, "issuer", false, "issuer column shown")
x509certsCmd.Flags().BoolVar(&config.showCrl, "crl", false, "crl column shown")
x509certsCmd.Flags().BoolVar(&config.showProvisioner, "provisioner", false, "provisioner column shown")
x509certsCmd.Flags().BoolVar(&config.showSignatureAlgorithm, "algorithm", false, "signature algorithm column shown")
}

/*
Expand Down
35 changes: 18 additions & 17 deletions cmd/defs_root.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,24 @@ func initChoices() {
Configuration structure.
*/
type tConfig struct {
emitSshFormat *tChoice
emitX509Format *tChoice
showCrl bool
showKeyId bool
sortOrder *tChoice
showValid bool
showExpired bool
showRevoked bool
showProvisioner bool
timeFormat *tChoice
showDNSNames bool
showEmailAddresses bool
showIPAddresses bool
showURIs bool
showIssuer bool
showSerial bool
showHostType bool
emitSshFormat *tChoice
emitX509Format *tChoice
showCrl bool
showKeyId bool
sortOrder *tChoice
showValid bool
showExpired bool
showRevoked bool
showProvisioner bool
timeFormat *tChoice
showDNSNames bool
showEmailAddresses bool
showIPAddresses bool
showURIs bool
showIssuer bool
showSerial bool
showHostType bool
showSignatureAlgorithm bool
}

/*
Expand Down

0 comments on commit f8c8a28

Please sign in to comment.