cmd/ca: copy CSR to audit dir when signing
This commit is contained in:
parent
9d160b97e3
commit
5198b85df9
|
@ -6,6 +6,7 @@ import (
|
||||||
"encoding/pem"
|
"encoding/pem"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
@ -71,10 +72,13 @@ func Sign(cmd *cobra.Command, args []string) {
|
||||||
Bytes: cert.Raw,
|
Bytes: cert.Raw,
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: copy CSR to audit dir
|
// copy CSR to audit dir
|
||||||
_ = auditDir
|
os.WriteFile(filepath.Join(auditDir, "csr.pem"), pem.EncodeToMemory(&pem.Block{
|
||||||
|
Type: pemfile.TypeX509CSR,
|
||||||
|
Bytes: csr.Raw,
|
||||||
|
}), 0600)
|
||||||
|
|
||||||
// write CSR to output file
|
// write cert to output file
|
||||||
switch outputFilename {
|
switch outputFilename {
|
||||||
case "", "-":
|
case "", "-":
|
||||||
os.Stdout.Write(raw)
|
os.Stdout.Write(raw)
|
||||||
|
|
Loading…
Reference in New Issue