Documentation ¶
Index ¶
- Constants
- func GenerateSelfSignedCertKey(host string, alternateIPs []net.IP, alternateDNS []string, ...) ([]byte, []byte, error)
- func GenerateSelfSignedCertKeyWithFixtures(host string, alternateIPs []net.IP, alternateDNS []string, ...) ([]byte, []byte, error)
- func NewDefaultConfig() *config
- func NewSelfSignedCACert(cfg Config, key crypto.Signer) (*x509.Certificate, error)
- type AltNames
- type Config
- type DNSRequest
- type Server
Constants ¶
const ( // CertificateBlockType is a possible value for pem.Block.Type. CertificateBlockType = "CERTIFICATE" // CertificateRequestBlockType is a possible value for pem.Block.Type. CertificateRequestBlockType = "CERTIFICATE REQUEST" // ECPrivateKeyBlockType is a possible value for pem.Block.Type. ECPrivateKeyBlockType = "EC PRIVATE KEY" // RSAPrivateKeyBlockType is a possible value for pem.Block.Type. RSAPrivateKeyBlockType = "RSA PRIVATE KEY" // PrivateKeyBlockType is a possible value for pem.Block.Type. PrivateKeyBlockType = "PRIVATE KEY" // PublicKeyBlockType is a possible value for pem.Block.Type. PublicKeyBlockType = "PUBLIC KEY" )
const ( VERSION = "2.3.4" USER_AGENT = "DNS-over-HTTPS/" + VERSION + " (+https://github.com/m13253/dns-over-https)" )
Variables ¶
This section is empty.
Functions ¶
func GenerateSelfSignedCertKey ¶
func GenerateSelfSignedCertKey(host string, alternateIPs []net.IP, alternateDNS []string, fixtureDirectory string) ([]byte, []byte, error)
GenerateSelfSignedCertKey creates a self-signed certificate and key for the given host. Host may be an IP or a DNS name You may also specify additional subject alt names (either ip or dns names) for the certificate.
func GenerateSelfSignedCertKeyWithFixtures ¶
func GenerateSelfSignedCertKeyWithFixtures(host string, alternateIPs []net.IP, alternateDNS []string, fixtureDirectory string) ([]byte, []byte, error)
GenerateSelfSignedCertKeyWithFixtures creates a self-signed certificate and key for the given host. Host may be an IP or a DNS name. You may also specify additional subject alt names (either ip or dns names) for the certificate.
If fixtureDirectory is non-empty, it is a directory path which can contain pre-generated certs. The format is: <host>.crt <host>.key Certs/keys not existing in that directory are created.
func NewDefaultConfig ¶
func NewDefaultConfig() *config
func NewSelfSignedCACert ¶
NewSelfSignedCACert creates a CA certificate
Types ¶
type AltNames ¶
AltNames contains the domain names and IP addresses that will be added to the API Server's x509 certificate SubAltNames field. The values will be passed directly to the x509.Certificate object.
type Config ¶
type Config struct { CommonName string Organization []string AltNames AltNames Usages []x509.ExtKeyUsage }
Config contains the basic fields required for creating a certificate
type DNSRequest ¶
type DNSRequest struct {
// contains filtered or unexported fields
}