Implement certificate creation

This commit is contained in:
adnano
2020-09-27 13:50:48 -04:00
parent e28e547bcf
commit 2eb7fb9ba4
10 changed files with 159 additions and 33 deletions

22
examples/cert/cert.go Normal file
View File

@@ -0,0 +1,22 @@
// +build example
package main
import (
"log"
"git.sr.ht/~adnano/go-gemini"
)
func main() {
host := "localhost"
crt, key, err := gemini.NewCertificate(host)
if err != nil {
log.Fatal(err)
}
if err := gemini.WriteCertificate(host, crt, key); err != nil {
log.Fatal(err)
}
}