security

package
v1.1.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2021 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

PulseHA - HA Cluster Daemon Copyright (C) 2017-2020 Andrew Zak <andrew@linux.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

View Source
const CertDir = "/etc/pulseha/certs/"

Variables

This section is empty.

Functions

func GenTLSKeys

func GenTLSKeys(ip string) error

* Generate TLS keys if they don't already exist

func GenerateCACert

func GenerateCACert(ip string)

*

func GenerateCerts

func GenerateCerts(ip string, caCert *x509.Certificate, caKey *rsa.PrivateKey)

Generate certs

func GenerateClientCert

func GenerateClientCert(caCert *x509.Certificate, caKey *rsa.PrivateKey)

*

func GenerateSHA256Hash

func GenerateSHA256Hash(str string) string

GenerateSHA256Hash - Generate a sha256 hash for a particular string

func GenerateServerCert

func GenerateServerCert(ip string, caCert *x509.Certificate, caKey *rsa.PrivateKey)

*

func SHA256StringValidation

func SHA256StringValidation(str string, strHash string) bool

SHA256StringValidation - Validate a string matches a generated hash

func WriteCertFile

func WriteCertFile(fileName string, cert []byte)

* TODO: Use Utils functions

func WriteKeyFile

func WriteKeyFile(fileName string, key []byte)

func WriteKeyFileFromRSAKey

func WriteKeyFileFromRSAKey(filename string, key *rsa.PrivateKey)

* TODO: Use Utils functions

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL