chclient

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetThumbprint

func GetThumbprint(cert string) ([sha1.Size]byte, error)

GetThumbprint calculates the thumbprint of a certificate in CredHub

Types

type CVConfig

type CVConfig struct {
	AccessToken       string `json:"access_token"`
	RefreshToken      string `json:"refresh_token"`
	CredhubBaseURL    string `json:"credhub_url"`
	AuthURL           string `json:"auth_url"`
	SkipTLSValidation bool   `json:"skip_tls_validation"`
}

CVConfig contains app config info and yaml tags

type ConfigLoader

type ConfigLoader struct {
	UserHomeDir    string
	CVConfigDir    string
	ConfigFilename string
}

ConfigLoader has configuration location info and methods to load the config

func (*ConfigLoader) ReadConfig

func (c *ConfigLoader) ReadConfig() (*CVConfig, error)

ReadConfig parses the CredHub client config file

type CredhubProxy

type CredhubProxy struct {
	BaseURL           string
	Username          string
	Password          string
	ClientID          string
	ClientSecret      string
	AccessToken       string
	RefreshToken      string
	AuthURL           string
	Client            *credhub.CredHub
	ConfigPath        string
	SkipTLSValidation bool
}

CredhubProxy contains the config information for the Credhub request proxy

func (*CredhubProxy) Auth

func (cp *CredhubProxy) Auth() error

Auth authenticates a new CredHub client

func (*CredhubProxy) AuthExisting

func (cp *CredhubProxy) AuthExisting() error

AuthExisting authenticates an existing CredHub client

func (*CredhubProxy) DeleteCert

func (cp *CredhubProxy) DeleteCert(name string) error

DeleteCert deletes a certificate from CredHub

func (*CredhubProxy) GenerateCertificate

func (cp *CredhubProxy) GenerateCertificate(name string, parameters generate.Certificate, overwrite credhub.Mode) (credentials.Certificate, error)

GenerateCertificate generates a certificate in CredHub

func (*CredhubProxy) GetCertificate

func (cp *CredhubProxy) GetCertificate(name string) (credentials.Certificate, error)

GetCertificate downloads a certificate from CredHub

func (*CredhubProxy) List

List lists certificates on CredHub

func (*CredhubProxy) PutCertificate

func (cp *CredhubProxy) PutCertificate(certName string, ca string, certificate string, privateKey string) error

PutCertificate uploads a certificate to CredHub

type ICredhubProxy

type ICredhubProxy interface {
	GenerateCertificate(name string, parameters generate.Certificate, overwrite credhub.Mode) (credentials.Certificate, error)
	PutCertificate(certName string, ca string, certificate string, privateKey string) error
	DeleteCert(name string) error
	List() ([]credentials.CertificateMetadata, error)
	GetCertificate(name string) (credentials.Certificate, error)
}

ICredhubProxy defines the interface for the proxy to communicate with Credhub

Jump to

Keyboard shortcuts

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