Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) CACertificateFilePath(caDir string) (string, error)
- func (c *Client) CAPrivKeyFilePath(caDir string) (string, error)
- func (c *Client) CheckCACertificateExistInDir(caDir string, dontAskRecreate ...bool) bool
- func (c *Client) CreateCACertificate(caDir string) error
- func (c *Client) CreatePrivateKeyAndCertificate(certificateDir, certificateName string, dnsNames []string, ...) error
- func (c *Client) EncodeRSAPrivateKeyToPEM(privateKey *rsa.PrivateKey) ([]byte, error)
- func (c *Client) GenerateSSHKeys(bitSize int, path string) error
- func (c *Client) GenerateSSHPublicKey(publicKey *rsa.PublicKey) ([]byte, error)
- func (c *Client) InstallCACertificate(caDir string) error
Constants ¶
This section is empty.
Variables ¶
var ErrNoCAPath = fmt.Errorf("no path provided")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CACertificateFilePath ¶
CACertificateFilePath returns the CA certificate path based on caDir.
func (*Client) CAPrivKeyFilePath ¶
CAPrivKeyFilePath returns the CA privkey path based on caDir.
func (*Client) CheckCACertificateExistInDir ¶
CheckCACertificateExistInDir checks if the CA Certificate PEM file already exists in Dir.
func (*Client) CreateCACertificate ¶
CreateCACertificate creates a Private Key and a Signed CA Certificate in PEM format and writes to file.
func (*Client) CreatePrivateKeyAndCertificate ¶
func (c *Client) CreatePrivateKeyAndCertificate( certificateDir, certificateName string, dnsNames []string, caCertificateFilePath, caPrivateKeyFilePath string, ) error
CreatePrivateKeyAndCertificate creates a Private Key and a Certificate signed by caCertificate and writes to file in PEM format.
func (*Client) EncodeRSAPrivateKeyToPEM ¶
func (c *Client) EncodeRSAPrivateKeyToPEM(privateKey *rsa.PrivateKey) ([]byte, error)
EncodeRSAPrivateKeyToPEM encodes Private Key from RSA to PEM format.
func (*Client) GenerateSSHKeys ¶
GenerateSSHKeys generates and writes SSH keys with bitSize and saves them to path.
func (*Client) GenerateSSHPublicKey ¶
GenerateSSHPublicKey takes a rsa.PublicKey and return bytes suitable for writing to .pub file returns in the format "ssh-rsa ...".
func (*Client) InstallCACertificate ¶
InstallCACertificate installs the generated CA certificate.