Documentation ¶
Overview ¶
Generate a self-signed X.509 certificate for a TLS server. Outputs to 'cert.pem' and 'key.pem' and will overwrite existing files. Cyrill: created a struct with a method to use it internally
Index ¶
- Constants
- func CreateDirectoryIfNotExists(path string)
- func DecodeJSON(r *http.Request, value interface{}) error
- func Ffjson_FormatBits(dst *bytes.Buffer, u uint64, base int, neg bool)
- func Ffjson_WriteJsonString(buf *bytes.Buffer, s string)
- func GeneratePems(listenAddress, pemDir, certFileName, keyFileName string) (string, error)
- func GetTempDir() string
- func GetTlsConfig() *tls.Config
- func NewPassword(length int) (string, error)
- func PathExists(path string) (bool, error)
- func RandomInt(n int) int
- func RandomString(length int) string
- func RenderFFJSON(w http.ResponseWriter, value FfjsonIf, status int) error
- func RenderJSON(w http.ResponseWriter, value interface{}, status int) error
- func RenderString(w http.ResponseWriter, status int, msg string) error
- func StringHash(str string) int
- func ValidateEmail(email string) bool
- func ValidateListenAddress(address string) (string, string, error)
- func WriteBody(w http.ResponseWriter, body []byte, status int, contentType string) error
- type FfjsonIf
Constants ¶
View Source
const (
DEFAULT_TLS_SESSION_CACHE_CAPACITY int = 128
)
Variables ¶
This section is empty.
Functions ¶
func CreateDirectoryIfNotExists ¶
func CreateDirectoryIfNotExists(path string)
func DecodeJSON ¶
func Ffjson_WriteJsonString ¶
func GeneratePems ¶
GeneratePems creates new PEM files if they not yet exists returns the name of the PEM directory and error|nil
func GetTlsConfig ¶
func NewPassword ¶
generates a random string with the crypto package
func PathExists ¶
func RandomString ¶
randomString generates a pseudo-random alpha-numeric string with given length.
func RenderFFJSON ¶
func RenderFFJSON(w http.ResponseWriter, value FfjsonIf, status int) error
func RenderJSON ¶
func RenderJSON(w http.ResponseWriter, value interface{}, status int) error
func RenderString ¶
func RenderString(w http.ResponseWriter, status int, msg string) error
func ValidateEmail ¶
ValidateEmail does what is says in a simple way and without regex. everybody is doing it with regex ;-)
Types ¶
Click to show internal directories.
Click to hide internal directories.