mirror of
https://git.sr.ht/~adnano/go-gemini
synced 2024-11-10 04:41:38 +01:00
25 lines
334 B
Go
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)
|
|
}
|
|
}
|