Skip to content

Commit f8c8a28

Browse files
feat: Show x509 signature algorithm.
1 parent 0969c0c commit f8c8a28

File tree

3 files changed

+34
-17
lines changed

3 files changed

+34
-17
lines changed

cmd/columns_x509certs.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func getX509Columns() []tX509Column {
4646
titleColor: color.Bold,
4747

4848
contentSource: func(x tX509CertificateProvisionerRevocation, _ tConfig) string {
49+
// return x.X509Certificate.SignatureAlgorithm.String()
4950
return x.X509Certificate.Subject.String()
5051
},
5152

@@ -160,6 +161,20 @@ func getX509Columns() []tX509Column {
160161
contentEscapeMD: true,
161162
},
162163

164+
tX509Column{
165+
isShown: func(tc tConfig) bool { return tc.showSignatureAlgorithm },
166+
title: func() string { return "Algorithm" }, // Static title.
167+
titleColor: color.Bold,
168+
169+
contentSource: func(x tX509CertificateProvisionerRevocation, _ tConfig) string {
170+
return x.X509Certificate.SignatureAlgorithm.String()
171+
},
172+
173+
contentColor: func(_ tX509CertificateProvisionerRevocation) color.Attribute { return color.FgWhite }, // Static color.
174+
contentAlignMD: ALIGN_LEFT,
175+
contentEscapeMD: true,
176+
},
177+
163178
tX509Column{
164179
isShown: func(_ tConfig) bool { return true }, // Always shown.
165180
title: func() string { return "Start" }, // Static title.

cmd/command_x509certs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func init() {
7070
x509certsCmd.Flags().BoolVar(&config.showIssuer, "issuer", false, "issuer column shown")
7171
x509certsCmd.Flags().BoolVar(&config.showCrl, "crl", false, "crl column shown")
7272
x509certsCmd.Flags().BoolVar(&config.showProvisioner, "provisioner", false, "provisioner column shown")
73+
x509certsCmd.Flags().BoolVar(&config.showSignatureAlgorithm, "algorithm", false, "signature algorithm column shown")
7374
}
7475

7576
/*

cmd/defs_root.go

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,24 @@ func initChoices() {
4949
Configuration structure.
5050
*/
5151
type tConfig struct {
52-
emitSshFormat *tChoice
53-
emitX509Format *tChoice
54-
showCrl bool
55-
showKeyId bool
56-
sortOrder *tChoice
57-
showValid bool
58-
showExpired bool
59-
showRevoked bool
60-
showProvisioner bool
61-
timeFormat *tChoice
62-
showDNSNames bool
63-
showEmailAddresses bool
64-
showIPAddresses bool
65-
showURIs bool
66-
showIssuer bool
67-
showSerial bool
68-
showHostType bool
52+
emitSshFormat *tChoice
53+
emitX509Format *tChoice
54+
showCrl bool
55+
showKeyId bool
56+
sortOrder *tChoice
57+
showValid bool
58+
showExpired bool
59+
showRevoked bool
60+
showProvisioner bool
61+
timeFormat *tChoice
62+
showDNSNames bool
63+
showEmailAddresses bool
64+
showIPAddresses bool
65+
showURIs bool
66+
showIssuer bool
67+
showSerial bool
68+
showHostType bool
69+
showSignatureAlgorithm bool
6970
}
7071

7172
/*

0 commit comments

Comments
 (0)