diff options
| author | adnano <[email protected]> | 2020-10-13 16:50:59 -0400 |
|---|---|---|
| committer | adnano <[email protected]> | 2020-10-13 16:50:59 -0400 |
| commit | 292fa7ee4fcab5da4d976ffb8dd15fbb67dfd214 (patch) | |
| tree | e7fa9d7537ae5c608f93ae3679c025b40a3b9e6c /cert.go | |
| parent | Move certificate verification code to VerifyConnection (diff) | |
| download | go-gemini-292fa7ee4fcab5da4d976ffb8dd15fbb67dfd214.tar.xz go-gemini-292fa7ee4fcab5da4d976ffb8dd15fbb67dfd214.zip | |
Remove WriteX509KeyPair function
Diffstat (limited to 'cert.go')
| -rw-r--r-- | cert.go | 26 |
1 files changed, 0 insertions, 26 deletions
@@ -9,7 +9,6 @@ import ( "encoding/pem" "math/big" "net" - "os" "path/filepath" "strings" "time" @@ -152,28 +151,3 @@ func NewRawCertificate(host string, duration time.Duration) (crt, key []byte, er return } - -// WriteX509KeyPair writes the provided certificate and private key -// to path.crt and path.key respectively. -func WriteX509KeyPair(path string, crt, key []byte) error { - // Write the certificate - crtPath := path + ".crt" - crtOut, err := os.OpenFile(crtPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600) - if err != nil { - return err - } - if _, err := crtOut.Write(crt); err != nil { - return err - } - - // Write the private key - keyPath := path + ".key" - keyOut, err := os.OpenFile(keyPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600) - if err != nil { - return err - } - if _, err := keyOut.Write(key); err != nil { - return err - } - return nil -} |