Documentation ¶
Index ¶
- Constants
- func Enroll(certsDir, endpoint string, timeout time.Duration, cc CredentialsClient) error
- func LoadCert(path string) (*x509.Certificate, error)
- func LoadCerts(path string) ([]*x509.Certificate, error)
- func LoadKey(path string) (crypto.PrivateKey, error)
- func SaveCert(path string, certs ...*x509.Certificate) error
- func SaveKey(key crypto.PrivateKey, path string) error
- type CredentialsClient
- type EnrollClient
Constants ¶
View Source
const ( KeyName = "key.pem" CertName = "cert.pem" CAChainName = "cacerts.pem" CAPoolName = "root.pem" )
File names used for saving and loading credentials
View Source
const ( ControllerServerName = "controller.openness" EnrollServerName = "enroll.controller.openness" )
Community edition controller server names
Variables ¶
This section is empty.
Functions ¶
func Enroll ¶
func Enroll(certsDir, endpoint string, timeout time.Duration, cc CredentialsClient) error
Enroll tries to load credentials from certsDir. If loading failed it requests credentials from endpoint and saves them to certsDir
func LoadCert ¶
func LoadCert(path string) (*x509.Certificate, error)
LoadCert verifies file permissions(0644) and loads a certificate
func LoadCerts ¶
func LoadCerts(path string) ([]*x509.Certificate, error)
LoadCerts verifies file permissions(0644) and loads all certificates If no certificates are found returns an error
func LoadKey ¶
func LoadKey(path string) (crypto.PrivateKey, error)
LoadKey verifies file permissions(0644) and loads a PEM encoded PKCS#8 key
Types ¶
type CredentialsClient ¶
type CredentialsClient interface { Get(id *pb.Identity, timeout time.Duration, endpoint string) (*pb.Credentials, error) }
CredentialsClient is the interface that wraps Get method Get gets credentials from the endpoint using provided id
Click to show internal directories.
Click to hide internal directories.