12 Commits
Author SHA1 Message Date
Nik Unger 68183f4853 Add and enforce copyright headers via linter
This commit normalizes copyright headers across the codebase.
2025-07-28 13:05:13 -04:00
Nik Unger 10bbc8cdc1 Fix current linter findings
This commit adds an explicit `golangci-lint` configuration that
simply matches the default linters previously in use, and then
fixes all current linter findings.

Aside from tweaking error message strings, this commit introduces
one externally visible behavior change: PEM data generated from
PKCS#12 files now correctly identifies private key blocks as
`RSA PRIVATE KEY` or `EC PRIVATE KEY`, whereas previously it
generated invalid `PRIVATE KEY` blocks with non-PKCS#8 data.

This commit lays the groundwork for more aggressive linting in the
future, and identifies some additional issues via TODOs.
2025-07-24 12:59:48 -04:00
Cedric Staub 75f2ec06b4 Switch to using SSLMate's PKCS#12 library (#293) 2022-09-21 10:36:59 -07:00
John Wood 44210f297c Remove ioutil (#289) 2022-08-11 10:59:59 -07:00
Roy Xu f81df5c5a3 print input format guessed by certigo (#210) 2020-02-25 11:17:01 -08:00
Roy XuandMat Byczkowski 23ed60d1d5 better error handling for csrs (#211)
Error when no valid certs are found when verifying instead of accessing oob.
Warn when CSRs are found instead of silently ignoring them.

Co-authored-by: Mat Byczkowski <mbyczkowski@gmail.com>
2020-02-25 10:58:06 -08:00
Matthew McPherrin 26cd65d9bd refactor certigo package main
This splits the logic into a cli, which handles parsing command line args and
reading files, and a terminal abstraction for handling user input and ouput.

All uses of os.Exit are removed in favor of returning errors.

Overall this enables better testing and reuse of code.  Previously we had to
rely on external unit testing for CLI tests, which are harder to write tests.
2020-01-13 15:58:53 -08:00
Cedric Staub 796d17c565 Better error message for library users 2018-03-22 13:30:07 -07:00
Cedric Staub fe74b984aa Better error handling in certigo dump command 2017-05-09 14:41:34 -07:00
Cedric Staub ed15e73d08 Return error instead of printing to stderr in lib 2016-12-12 12:33:30 -08:00
Cedric Staub 4704138725 Better naming and doc comments 2016-10-07 14:26:03 -07:00
Cedric Staub d9d52c5712 Factor out useful functions into library 2016-10-07 13:16:07 -07:00