You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Go package for creating temporary x509 test certificates
7
+
testcerts is a Go package that makes it easy for developers to generate x509 certificates for testing and development purposes. The package provides an easy-to-use API for generating self-signed certificates and keys for testing.
8
8
9
-
There are many Certificate generation tools out there, but most focus on being a CLI tool. This package is focused on providing helper functions for creating Certificates. These helper functions can be used as part of Go tests per the example below.
9
+
What makes testcerts unique is its ability to generate certificates and keys with a single line of code, and also its ability to handle saving them to temp and non-temp files, which eliminates the need for developers to handle file operations while testing their code.
10
+
11
+
Overall, testcerts simplifies the process of generating and managing test certificates, making it a valuable tool for any developer working with x509 certificates.
12
+
13
+
## Usage
14
+
15
+
### Generating Certificates to File
16
+
17
+
The `GenerateCertsToFile` function generates an X.509 certificate and key and writes them to the file paths provided.
The goal of this package, is to make testing TLS based services easier. Without having to leave the comfort of your editor, or place test certificates in your repo.
34
+
### Generating Certificates to Temporary File
35
+
36
+
The `GenerateCertsToTempFile` function generates an X.509 certificate and key and writes them to randomly generated files in the directory provided or the system's temporary directory if none is provided. The function returns the file paths of the generated files.
0 commit comments