aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorGibheer <gibheer@gmail.com>2015-03-30 21:52:39 +0200
committerGibheer <gibheer@gmail.com>2015-03-30 21:52:39 +0200
commit37423989c812e9a7972b6f272128e5f1e64c2827 (patch)
tree5f5120db8e7e9c3b2045c20478fe65298d20abda /main.go
parent9ba6a88449e6297ea925e0c59e923c56e742983f (diff)
split certificate stuff into own file
This moves the complicated certificate flag handling into its own file to make it a bit easier to handle.
Diffstat (limited to 'main.go')
-rw-r--r--main.go25
1 files changed, 0 insertions, 25 deletions
diff --git a/main.go b/main.go
index a4eec3f..9b9ab0a 100644
--- a/main.go
+++ b/main.go
@@ -117,31 +117,6 @@ func create_sign_request(cmd *Command, args []string) {
}
}
-func create_cert(cmd *Command, args []string) {
- err := checkFlags(checkPrivateKey, checkOutput, checkCSR, checkCertFlags)
- if err != nil {
- crash_with_help(cmd, ErrorFlagInput, "Flags invalid: %s", err)
- }
-
- // TODO implement flags for all certificate options
- cert, err := FlagCertificateSignRequest.ToCertificate(
- FlagPrivateKey,
- FlagCertificateGeneration,
- nil,
- )
- if err != nil {
- crash_with_help(cmd, ErrorProgram, "Error generating certificate: %s", err)
- }
- pem_block, err := cert.MarshalPem()
- if err != nil {
- crash_with_help(cmd, ErrorProgram, "Error when marshalling to pem: %s", err)
- }
- _, err = pem_block.WriteTo(FlagOutput)
- if err != nil {
- crash_with_help(cmd, ErrorProgram, "Could not write to output: %s", err)
- }
-}
-
// crash and provide a helpful message
func crash_with_help(cmd *Command, code int, message string, args ...interface{}) {
fmt.Fprintf(os.Stderr, message+"\n", args...)