1
0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-11-10 04:41:38 +01:00
go-gemini/examples/cert/cert.go
2020-09-28 18:19:59 -04:00

25 lines
334 B
Go

// +build example
package main
import (
"log"
"time"
"git.sr.ht/~adnano/gmi"
)
func main() {
host := "localhost"
duration := 365 * 24 * time.Hour
crt, key, err := gmi.NewRawCertificate(host, duration)
if err != nil {
log.Fatal(err)
}
if err := gmi.WriteCertificate(host, crt, key); err != nil {
log.Fatal(err)
}
}