Documentation ¶
Index ¶
- func CertOrKeyExist(pkiPath, name string) bool
- func NewCertAndKey(caCert *x509.Certificate, caKey *rsa.PrivateKey, config certutil.Config) (*x509.Certificate, *rsa.PrivateKey, error)
- func NewCertificateAuthority() (*x509.Certificate, *rsa.PrivateKey, error)
- func TryLoadAnyCertFromDisk(certificatePath string) (*x509.Certificate, error)
- func TryLoadAnyKeyFromDisk(privateKeyPath string) (*rsa.PrivateKey, error)
- func TryLoadCertAndKeyFromDisk(pkiPath, name string) (*x509.Certificate, *rsa.PrivateKey, error)
- func TryLoadCertFromDisk(pkiPath, name string) (*x509.Certificate, error)
- func TryLoadKeyFromDisk(pkiPath, name string) (*rsa.PrivateKey, error)
- func TryLoadPublicKeyFromDisk(pkiPath, name string) (*rsa.PublicKey, error)
- func WriteCert(pkiPath, name string, cert *x509.Certificate) error
- func WriteCertAndKey(pkiPath string, name string, cert *x509.Certificate, key *rsa.PrivateKey) error
- func WriteKey(pkiPath, name string, key *rsa.PrivateKey) error
- func WritePublicKey(pkiPath, name string, key *rsa.PublicKey) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CertOrKeyExist ¶
CertOrKeyExist retuns a boolean whether the cert or the key exists
func NewCertAndKey ¶
func NewCertAndKey(caCert *x509.Certificate, caKey *rsa.PrivateKey, config certutil.Config) (*x509.Certificate, *rsa.PrivateKey, error)
NewCertAndKey - new cert and key
func NewCertificateAuthority ¶
func NewCertificateAuthority() (*x509.Certificate, *rsa.PrivateKey, error)
NewCertificateAuthority create a new CA
func TryLoadAnyCertFromDisk ¶
func TryLoadAnyCertFromDisk(certificatePath string) (*x509.Certificate, error)
TryLoadAnyCertFromDisk tries to load the cert from the disk and validates that it is valid
func TryLoadAnyKeyFromDisk ¶
func TryLoadAnyKeyFromDisk(privateKeyPath string) (*rsa.PrivateKey, error)
TryLoadAnyKeyFromDisk tries to load the key from the disk and validates that it is valid
func TryLoadCertAndKeyFromDisk ¶
func TryLoadCertAndKeyFromDisk(pkiPath, name string) (*x509.Certificate, *rsa.PrivateKey, error)
TryLoadCertAndKeyFromDisk tries to load a cert and a key from the disk and validates that they are valid
func TryLoadCertFromDisk ¶
func TryLoadCertFromDisk(pkiPath, name string) (*x509.Certificate, error)
TryLoadCertFromDisk tries to load the cert from the disk and validates that it is valid
func TryLoadKeyFromDisk ¶
func TryLoadKeyFromDisk(pkiPath, name string) (*rsa.PrivateKey, error)
TryLoadKeyFromDisk tries to load the key from the disk and validates that it is valid
func TryLoadPublicKeyFromDisk ¶
TryLoadPublicKeyFromDisk - will verify a Public key and return it if OK
func WriteCert ¶
func WriteCert(pkiPath, name string, cert *x509.Certificate) error
WriteCert - writes a public cert as name at pkiPath
func WriteCertAndKey ¶
func WriteCertAndKey(pkiPath string, name string, cert *x509.Certificate, key *rsa.PrivateKey) error
WriteCertAndKey - save new key and cert to disk at pkiPath as name
Types ¶
This section is empty.