1
0
Fork 0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-05-28 22:16:10 +02:00
go-gemini/store.go
2020-09-26 15:14:34 -04:00

25 lines
521 B
Go

package gemini
import (
"crypto/x509"
)
// CertificateStore maps hostnames to certificates.
type CertificateStore struct {
store map[string]*x509.Certificate // map of hostnames to certificates
}
func NewCertificateStore() *CertificateStore {
return &CertificateStore{
store: map[string]*x509.Certificate{},
}
}
func (c *CertificateStore) Put(hostname string, cert *x509.Certificate) {
c.store[hostname] = cert
}
func (c *CertificateStore) Get(hostname string) *x509.Certificate {
return c.store[hostname]
}