From bb41ff218a14b6597607408de6efed37cc8dae40 Mon Sep 17 00:00:00 2001 From: Gibheer Date: Tue, 24 Mar 2015 21:21:02 +0100 Subject: add start and end date to certificates This adds the start and end date flags for certificate generation and also a flag to define, if the resulting certificate should be a CA or not. Next step in the implementation is to define the key usages. --- main.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index ba8ee0a..4d7419c 100644 --- a/main.go +++ b/main.go @@ -6,7 +6,6 @@ import ( "fmt" "io" "io/ioutil" - "math/big" "os" "github.com/gibheer/pki" @@ -119,17 +118,15 @@ func create_sign_request(cmd *Command, args []string) { } func create_cert(cmd *Command, args []string) { - err := checkFlags(checkPrivateKey, checkOutput, checkCSR) + 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_opts := pki.CertificateOptions{} - cert_opts.SerialNumber = big.NewInt(1) cert, err := FlagCertificateSignRequest.ToCertificate( FlagPrivateKey, - cert_opts, + FlagCertificateGeneration, nil, ) if err != nil { crash_with_help(cmd, ErrorProgram, "Error generating certificate: %s", err) } -- cgit v1.2.3-70-g09d2