Documentation ¶
Index ¶
- Constants
- func APIConfig(caFile string, insecure bool) (*tls.Config, error)
- func Fingerprint(b []byte) string
- type CertificateAuthority
- func (ca *CertificateAuthority) Revoke(serial string) error
- func (ca *CertificateAuthority) ServerConfig() (*tls.Config, error)
- func (ca *CertificateAuthority) Sign(data []byte) (core.ClientCert, error)
- func (ca *CertificateAuthority) Verify(state tls.ConnectionState, host string) (string, error)
- func (ca *CertificateAuthority) WebConfig() (*tls.Config, error)
- type Client
- func (c *Client) Config() (*tls.Config, error)
- func (c *Client) Csr() ([]byte, error)
- func (c *Client) RemoveCA() error
- func (c *Client) RemoveCsr() error
- func (c *Client) RemoveKey() error
- func (c *Client) RemovePem() error
- func (c *Client) Signed() bool
- func (c *Client) WriteCA(b []byte) error
- func (c *Client) WritePem(b []byte) error
Constants ¶
View Source
const (
// CAFile is the default ca file name
CAFile = "ca.pem"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CertificateAuthority ¶
type CertificateAuthority struct { // protects crl sync.RWMutex // contains filtered or unexported fields }
CertificateAuthority is the server ca
var CA *CertificateAuthority
CA represents the server's certificate authority
func NewCA ¶
func NewCA(caDir, HTTPCert, HTTPKey string, serverNames []string) (ca *CertificateAuthority, err error)
NewCA returns a new server ca
func (*CertificateAuthority) Revoke ¶
func (ca *CertificateAuthority) Revoke(serial string) error
Revoke revokes the provided certificate
func (*CertificateAuthority) ServerConfig ¶
func (ca *CertificateAuthority) ServerConfig() (*tls.Config, error)
ServerConfig returns a tls.Config for the harkonn server
func (*CertificateAuthority) Sign ¶
func (ca *CertificateAuthority) Sign(data []byte) (core.ClientCert, error)
Sign signs a csr
func (*CertificateAuthority) Verify ¶
func (ca *CertificateAuthority) Verify(state tls.ConnectionState, host string) (string, error)
Verify verifies the client hostname and certificate revocation
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the client ca
Click to show internal directories.
Click to hide internal directories.