auth

package
v0.0.0-...-9774daa Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2015 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCertificate

func CreateCertificate(logger log.Logger, req *x509.CertificateRequest, key *rsa.PrivateKey, years int, hostList string) ([]byte, error)

CreateCertificate generates a new cert

func CreateCertificateAuthority

func CreateCertificateAuthority(logger log.Logger, key *rsa.PrivateKey, years int, org, country, hostList string) ([]byte, error)

CreateCertificateAuthority generates a new CA

func CreateCertificateRequest

func CreateCertificateRequest(logger log.Logger, key *rsa.PrivateKey, name, org, country, hostList string) (*x509.CertificateRequest, []byte, error)

CreateCertificateRequest generates a new certificate request

func CreateFingerprint

func CreateFingerprint(key []byte) string

CreateFingerprint generates an md5 fingerprint

func CreatePkiDirectories

func CreatePkiDirectories(logger log.Logger, root string) error

CreatePkiDirectories creates the directory structures for storing the public and private keys.

func GenerateSubjectKeyID

func GenerateSubjectKeyID(key *rsa.PrivateKey) (bytes []byte, err error)

GenerateSubjectKeyID creates a subject id based on a private key.

func ReadCertificate

func ReadCertificate(filename string, certType string) (*pem.Block, error)

ReadCertificate reads a cert file and validates the header

func ReadPrivateKey

func ReadPrivateKey(logger log.Logger, keyFile string) (privateKey ssh.Signer, err error)

ReadPrivateKey reads a private key file

func SaveCertificate

func SaveCertificate(logger log.Logger, cert []byte, filename string)

SaveCertificate saves a certificate in the PEM format.

func SaveCertificateRequest

func SaveCertificateRequest(logger log.Logger, cert []byte, filename string)

SaveCertificateRequest saves a certificate in the PEM format.

func SavePrivateKey

func SavePrivateKey(logger log.Logger, key *rsa.PrivateKey, filename string)

SavePrivateKey saves a PrivateKey in the PEM format.

func SavePublicKey

func SavePublicKey(logger log.Logger, key *rsa.PrivateKey, filename string)

SavePublicKey saves a public key in the PEM format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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