Documentation ¶
Index ¶
- Constants
- func CreateCert(rootCert *x509.Certificate, rootPrivateKey *ecdsa.PrivateKey, ...) (*x509.Certificate, error)
- func CreateRootCert(privateKey *ecdsa.PrivateKey) (*x509.Certificate, error)
- func LoadCert(filename string) (*x509.Certificate, error)
- func LoadKey(filename string) (*ecdsa.PrivateKey, error)
- func MarshalCert(cert *x509.Certificate) (text []byte, err error)
- func MarshalKey(privateKey *ecdsa.PrivateKey) (text []byte, err error)
- func NewClientTLSConfig(cacert, cert, key, serverName string) (*tls.Config, error)
- func NewServerTLSConfig(cacert, cert, key string) (*tls.Config, error)
- func NewTLSConfig(cacert, cert, key, serverName string, isServer bool) (*tls.Config, error)
- func SaveCert(filename string, cert *x509.Certificate) error
- func SaveKey(filename string, privateKey *ecdsa.PrivateKey) error
- func UnmarshalCert(b []byte) (*x509.Certificate, error)
- func UnmarshalKey(b []byte) (*ecdsa.PrivateKey, error)
- type CertUsageType
- type CertificateFactory
Constants ¶
View Source
const ( CertificatePath string = "/milpa/certificate" CertificateDirectoryPlaceholder string = "/milpa/certificate/." RootCertPath string = "/milpa/certificate/root.crt" RootKeyPath string = "/milpa/certificate/root.key" )
Variables ¶
This section is empty.
Functions ¶
func CreateCert ¶
func CreateCert(rootCert *x509.Certificate, rootPrivateKey *ecdsa.PrivateKey, serverPublicKey *ecdsa.PublicKey, certUsage CertUsageType) (*x509.Certificate, error)
func CreateRootCert ¶
func CreateRootCert(privateKey *ecdsa.PrivateKey) (*x509.Certificate, error)
func MarshalCert ¶
func MarshalCert(cert *x509.Certificate) (text []byte, err error)
func MarshalKey ¶
func MarshalKey(privateKey *ecdsa.PrivateKey) (text []byte, err error)
func NewClientTLSConfig ¶
func NewTLSConfig ¶
func UnmarshalCert ¶
func UnmarshalCert(b []byte) (*x509.Certificate, error)
func UnmarshalKey ¶
func UnmarshalKey(b []byte) (*ecdsa.PrivateKey, error)
Types ¶
type CertificateFactory ¶
type CertificateFactory struct { Root x509.Certificate // contains filtered or unexported fields }
func NewFake ¶
func NewFake() (*CertificateFactory, error)
func (*CertificateFactory) CreateClientCert ¶
func (fac *CertificateFactory) CreateClientCert() (*tls.Certificate, error)
func (*CertificateFactory) CreateNodeCertAndKey ¶
func (fac *CertificateFactory) CreateNodeCertAndKey() (*x509.Certificate, *ecdsa.PrivateKey, error)
func (*CertificateFactory) GetRootFromStore ¶
func (fac *CertificateFactory) GetRootFromStore() error
func (*CertificateFactory) InitRootCert ¶
func (fac *CertificateFactory) InitRootCert() error
Click to show internal directories.
Click to hide internal directories.