Documentation ¶
Index ¶
- func CreateCertReq(opts *CertOptions, privateKey *rsa.PrivateKey) (*x509.CertificateRequest, error)
- func CreateCertReqWithKey(opts *CertOptions) (*x509.CertificateRequest, *rsa.PrivateKey, error)
- func InitCA(opts *CertOptions, certOut, keyOut string) error
- func LoadCertificate(filename string) (*x509.Certificate, error)
- func LoadFromPEMFile(filename string) ([]interface{}, error)
- func LoadPrivateKey(filename string) (*rsa.PrivateKey, error)
- func LoadPublicKey(filename string) (*rsa.PublicKey, error)
- func LoadRequest(filename string) (*x509.CertificateRequest, error)
- func MakeReq(opts *CertOptions, keyIn, keyOut, reqOut string) error
- func SaveToPEMFile(filename string, data []interface{}) error
- func SignCertReq(req *x509.CertificateRequest, ca *CA, opts *CertOptions) (*x509.Certificate, error)
- func SignReq(opts *CertOptions, caCrtPath, caKeyPath, reqPath, certOut string, verify bool) error
- type CA
- type CertNames
- type CertOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCertReq ¶
func CreateCertReq(opts *CertOptions, privateKey *rsa.PrivateKey) (*x509.CertificateRequest, error)
CreateCertReq creates a new x.509 certificate request for an existing private key.
func CreateCertReqWithKey ¶
func CreateCertReqWithKey(opts *CertOptions) (*x509.CertificateRequest, *rsa.PrivateKey, error)
CreateCertReqWithKey creates a new x.509 certificate request with a newly generated private key.
func InitCA ¶
func InitCA(opts *CertOptions, certOut, keyOut string) error
func LoadCertificate ¶
func LoadCertificate(filename string) (*x509.Certificate, error)
LoadCertificate loads a single certificate from a file.
func LoadFromPEMFile ¶
LoadFromPEMFile loads certificate data from a PEM file.
func LoadPrivateKey ¶
func LoadPrivateKey(filename string) (*rsa.PrivateKey, error)
LoadPrivateKey loads a single RSA private key from a file.
func LoadPublicKey ¶
LoadPublicKey loads a single RSA public key from a file.
func LoadRequest ¶
func LoadRequest(filename string) (*x509.CertificateRequest, error)
LoadRequest loads a single certificate request from a file.
func MakeReq ¶
func MakeReq(opts *CertOptions, keyIn, keyOut, reqOut string) error
func SaveToPEMFile ¶
SaveToPEMFile saves certificate data to a PEM file.
func SignCertReq ¶
func SignCertReq(req *x509.CertificateRequest, ca *CA, opts *CertOptions) (*x509.Certificate, error)
SignCertReq signs a certificate request using a CA key.
Types ¶
type CA ¶
type CA struct { Certificate *x509.Certificate PrivateKey *rsa.PrivateKey }
CA contains internal data for a certificate authority.
func CreateCA ¶
func CreateCA(opts *CertOptions) (*CA, error)
CreateCA initializes a new CertKeyPair from given parameters.
type CertNames ¶
CertNames lists the subjectAltNames that can be assigned to a certificate or request.
func GetReqNames ¶
func GetReqNames(request *x509.CertificateRequest) (*CertNames, error)
GetReqNames returns the names coded into a certificate request, including Receptor node IDs.