Documentation ¶
Index ¶
- func CreateCertificate(logger log.Logger, req *x509.CertificateRequest, key *rsa.PrivateKey, ...) ([]byte, error)
- func CreateCertificateAuthority(logger log.Logger, key *rsa.PrivateKey, years int, ...) ([]byte, error)
- func CreateCertificateRequest(logger log.Logger, key *rsa.PrivateKey, name, org, country, hostList string) (*x509.CertificateRequest, []byte, error)
- func CreateFingerprint(key []byte) string
- func CreatePkiDirectories(logger log.Logger, root string) error
- func GenerateSubjectKeyID(key *rsa.PrivateKey) (bytes []byte, err error)
- func ReadCertificate(filename string, certType string) (*pem.Block, error)
- func ReadPrivateKey(logger log.Logger, keyFile string) (privateKey ssh.Signer, err error)
- func SaveCertificate(logger log.Logger, cert []byte, filename string)
- func SaveCertificateRequest(logger log.Logger, cert []byte, filename string)
- func SavePrivateKey(logger log.Logger, key *rsa.PrivateKey, filename string)
- func SavePublicKey(logger log.Logger, key *rsa.PrivateKey, filename string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCertificate ¶
func CreateCertificate(logger log.Logger, req *x509.CertificateRequest, key *rsa.PrivateKey, years int, hostList string) ([]byte, error)
CreateCertificate generates a new cert
func CreateCertificateAuthority ¶
func CreateCertificateAuthority(logger log.Logger, key *rsa.PrivateKey, years int, org, country, hostList string) ([]byte, error)
CreateCertificateAuthority generates a new CA
func CreateCertificateRequest ¶
func CreateCertificateRequest(logger log.Logger, key *rsa.PrivateKey, name, org, country, hostList string) (*x509.CertificateRequest, []byte, error)
CreateCertificateRequest generates a new certificate request
func CreateFingerprint ¶
CreateFingerprint generates an md5 fingerprint
func CreatePkiDirectories ¶
CreatePkiDirectories creates the directory structures for storing the public and private keys.
func GenerateSubjectKeyID ¶
func GenerateSubjectKeyID(key *rsa.PrivateKey) (bytes []byte, err error)
GenerateSubjectKeyID creates a subject id based on a private key.
func ReadCertificate ¶
ReadCertificate reads a cert file and validates the header
func ReadPrivateKey ¶
ReadPrivateKey reads a private key file
func SaveCertificate ¶
SaveCertificate saves a certificate in the PEM format.
func SaveCertificateRequest ¶
SaveCertificateRequest saves a certificate in the PEM format.
func SavePrivateKey ¶
func SavePrivateKey(logger log.Logger, key *rsa.PrivateKey, filename string)
SavePrivateKey saves a PrivateKey in the PEM format.
func SavePublicKey ¶
func SavePublicKey(logger log.Logger, key *rsa.PrivateKey, filename string)
SavePublicKey saves a public key in the PEM format.
Types ¶
This section is empty.