auth

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptPGPString

func DecryptPGPString(data string, prKey string) (string, error)

DecryptPGPString decrypts a PGP encoded input string and returns a base64 representation of the decoded string

func EncryptPGPString

func EncryptPGPString(data string, pbKey string) (string, error)

EncryptPGPString takes data and a public key and encrypts using that public key

func GeneratePGPKeyPair

func GeneratePGPKeyPair() (string, string, error)

GeneratePGPKeyPair produces a PGP key pair and returns two things: A base64 encoded form of the public part of the entity A base64 encoded form of the private key

func GetTLSConfig

func GetTLSConfig(caCertFile string, certFile string, keyFile string) (*tls.Config, error)

GetTLSConfig initializes a tlsConfig using the CA's certificate This config is then used to enable the server for mutual TLS

func ReadFromFile

func ReadFromFile(fileName string) (string, error)

ReadFromFile reads a file and loads the PGP key into a string

func WriteToFile

func WriteToFile(data string, fileName string) error

WriteToFile writes a PGP key into a file. It will truncate the file if it exists

Types

This section is empty.

Jump to

Keyboard shortcuts

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