Documentation
¶
Index ¶
- Constants
- Variables
- func CompareHashAndPassword(hashedPassword []byte, password string) error
- func CreateCAPair(certsDir, caKeyPath string, keySize int, lifetime time.Duration, ...) error
- func CreateClientPair(certsDir, caKeyPath string, keySize int, lifetime time.Duration, ...) error
- func CreateNodePair(certsDir, caKeyPath string, keySize int, lifetime time.Duration, ...) error
- func ExtKeyUsageToString(eku x509.ExtKeyUsage) string
- func GenerateCA(signer crypto.Signer, lifetime time.Duration) ([]byte, error)
- func GenerateClientCert(caCert *x509.Certificate, caPrivateKey crypto.PrivateKey, ...) ([]byte, error)
- func GenerateServerCert(caCert *x509.Certificate, caPrivateKey crypto.PrivateKey, ...) ([]byte, error)
- func GetCertificateUser(tlsState *tls.ConnectionState) (string, error)
- func HashPassword(password string) ([]byte, error)
- func KeyUsageToString(ku x509.KeyUsage) []string
- func LoadClientTLSConfig(sslCA, sslCert, sslCertKey string) (*tls.Config, error)
- func LoadServerTLSConfig(sslCA, sslCert, sslCertKey string) (*tls.Config, error)
- func PEMContentsToX509(contents []byte) ([]*x509.Certificate, error)
- func PEMToCertificates(contents []byte) ([]*pem.Block, error)
- func PEMToPrivateKey(contents []byte) (crypto.PrivateKey, error)
- func PrivateKeyToPEM(key crypto.PrivateKey) (*pem.Block, error)
- func PromptForPassword() (string, error)
- func PromptForPasswordAndHash() ([]byte, error)
- func PromptForPasswordTwice() (string, error)
- func ProtoAuthHook(insecureMode bool, tlsState *tls.ConnectionState) (func(proto.Message, bool) error, error)
- func ResetAssetLoader()
- func SetAssetLoader(al AssetLoader)
- func WritePEMToFile(path string, mode os.FileMode, overwrite bool, blocks ...*pem.Block) error
- type AssetLoader
- type CertInfo
- type CertificateLoader
- type CertificateManager
- func (cm *CertificateManager) CACert() *CertInfo
- func (cm *CertificateManager) CACertPath() string
- func (cm *CertificateManager) ClientCertPath(user string) string
- func (cm *CertificateManager) ClientCerts() map[string]*CertInfo
- func (cm *CertificateManager) ClientKeyPath(user string) string
- func (cm *CertificateManager) GetCACertPath() (string, error)
- func (cm *CertificateManager) GetClientCertPaths(user string) (string, string, error)
- func (cm *CertificateManager) GetClientTLSConfig(user string) (*tls.Config, error)
- func (cm *CertificateManager) GetEmbeddedServerTLSConfig(_ *tls.ClientHelloInfo) (*tls.Config, error)
- func (cm *CertificateManager) GetServerTLSConfig() (*tls.Config, error)
- func (cm *CertificateManager) ListCertificates() ([]*CertInfo, error)
- func (cm *CertificateManager) LoadCertificates() error
- func (cm *CertificateManager) Metrics() CertificateMetrics
- func (cm *CertificateManager) NodeCert() *CertInfo
- func (cm *CertificateManager) NodeCertPath() string
- func (cm *CertificateManager) NodeKeyPath() string
- func (cm *CertificateManager) RegisterSignalHandler(stopper *stop.Stopper)
- type CertificateMetrics
- type RequestWithUser
- type UserAuthHook
Constants ¶
View Source
const ( // NodeUser is used by nodes for intra-cluster traffic. NodeUser = "node" // RootUser is the default cluster administrator. RootUser = "root" )
View Source
const ( // CAPem describes a CA certificate. CAPem pemUsage // NodePem describes a combined server/client certificate for user Node. NodePem // ClientPem describes a client certificate. ClientPem )
View Source
const ( EmbeddedCertsDir = "test_certs" EmbeddedCACert = "ca.crt" EmbeddedCAKey = "ca.key" EmbeddedNodeCert = "node.crt" EmbeddedNodeKey = "node.key" EmbeddedRootCert = "client.root.crt" EmbeddedRootKey = "client.root.key" EmbeddedTestUserCert = "client.testuser.crt" EmbeddedTestUserKey = "client.testuser.key" )
EmbeddedCertsDir is the certs directory inside embedded assets. Embedded*{Cert,Key} are the filenames for embedded certs.
Variables ¶
View Source
var ErrEmptyPassword =