@@ -28,7 +28,7 @@ var createRevocationListCmd = &cobra.Command{
2828 Short : "Create a new revocation list signed by the private root key" ,
2929 SilenceUsage : true ,
3030 RunE : func (cmd * cobra.Command , args []string ) error {
31- return handleCreateRevocationList (revocationListFile , privateRootKeyFile )
31+ return handleCreateRevocationList (cmd , revocationListFile , privateRootKeyFile )
3232 },
3333}
3434
@@ -37,7 +37,7 @@ var extendRevocationListCmd = &cobra.Command{
3737 Short : "Extend an existing revocation list with a given key ID" ,
3838 SilenceUsage : true ,
3939 RunE : func (cmd * cobra.Command , args []string ) error {
40- return handleExtendRevocationList (keyID , revocationListFile , privateRootKeyFile )
40+ return handleExtendRevocationList (cmd , keyID , revocationListFile , privateRootKeyFile )
4141 },
4242}
4343
@@ -46,7 +46,7 @@ var verifyRevocationListCmd = &cobra.Command{
4646 Short : "Verify a revocation list signature using the public root key" ,
4747 SilenceUsage : true ,
4848 RunE : func (cmd * cobra.Command , args []string ) error {
49- return handleVerifyRevocationList (revocationListFile , signatureFile , publicRootKeyFile )
49+ return handleVerifyRevocationList (cmd , revocationListFile , signatureFile , publicRootKeyFile )
5050 },
5151}
5252
@@ -93,7 +93,7 @@ func init() {
9393 }
9494}
9595
96- func handleCreateRevocationList (revocationListFile string , privateRootKeyFile string ) error {
96+ func handleCreateRevocationList (cmd * cobra. Command , revocationListFile string , privateRootKeyFile string ) error {
9797 privKeyPEM , err := os .ReadFile (privateRootKeyFile )
9898 if err != nil {
9999 return fmt .Errorf ("failed to read private root key file: %w" , err )
@@ -113,11 +113,11 @@ func handleCreateRevocationList(revocationListFile string, privateRootKeyFile st
113113 return fmt .Errorf ("failed to write output files: %w" , err )
114114 }
115115
116- fmt .Println ("✅ Revocation list created successfully" )
116+ cmd .Println ("✅ Revocation list created successfully" )
117117 return nil
118118}
119119
120- func handleExtendRevocationList (keyID , revocationListFile , privateRootKeyFile string ) error {
120+ func handleExtendRevocationList (cmd * cobra. Command , keyID , revocationListFile , privateRootKeyFile string ) error {
121121 privKeyPEM , err := os .ReadFile (privateRootKeyFile )
122122 if err != nil {
123123 return fmt .Errorf ("failed to read private root key file: %w" , err )
@@ -152,11 +152,11 @@ func handleExtendRevocationList(keyID, revocationListFile, privateRootKeyFile st
152152 return fmt .Errorf ("failed to write output files: %w" , err )
153153 }
154154
155- fmt .Println ("✅ Revocation list extended successfully" )
155+ cmd .Println ("✅ Revocation list extended successfully" )
156156 return nil
157157}
158158
159- func handleVerifyRevocationList (revocationListFile , signatureFile , publicRootKeyFile string ) error {
159+ func handleVerifyRevocationList (cmd * cobra. Command , revocationListFile , signatureFile , publicRootKeyFile string ) error {
160160 // Read revocation list file
161161 rlBytes , err := os .ReadFile (revocationListFile )
162162 if err != nil {
@@ -194,15 +194,15 @@ func handleVerifyRevocationList(revocationListFile, signatureFile, publicRootKey
194194 }
195195
196196 // Display results
197- fmt .Println ("✅ Revocation list signature is valid" )
198- fmt .Printf ("Last Updated: %s\n " , rl .LastUpdated .Format (time .RFC3339 ))
199- fmt .Printf ("Expires At: %s\n " , rl .ExpiresAt .Format (time .RFC3339 ))
200- fmt .Printf ("Number of revoked keys: %d\n " , len (rl .Revoked ))
197+ cmd .Println ("✅ Revocation list signature is valid" )
198+ cmd .Printf ("Last Updated: %s\n " , rl .LastUpdated .Format (time .RFC3339 ))
199+ cmd .Printf ("Expires At: %s\n " , rl .ExpiresAt .Format (time .RFC3339 ))
200+ cmd .Printf ("Number of revoked keys: %d\n " , len (rl .Revoked ))
201201
202202 if len (rl .Revoked ) > 0 {
203- fmt .Println ("\n Revoked Keys:" )
203+ cmd .Println ("\n Revoked Keys:" )
204204 for keyID , revokedTime := range rl .Revoked {
205- fmt .Printf (" - %s (revoked at: %s)\n " , keyID , revokedTime .Format (time .RFC3339 ))
205+ cmd .Printf (" - %s (revoked at: %s)\n " , keyID , revokedTime .Format (time .RFC3339 ))
206206 }
207207 }
208208
0 commit comments