util

package
v1.8.57 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractServiceName

func ExtractServiceName(arn, comp string) (string, string, error)

func FileExists

func FileExists(path string) bool

func GenerateCSR

func GenerateCSR(key *rsa.PrivateKey, domain, service, commonName, instanceId, provider, spiffe, ztsAwsDomain string, rfc822 bool) (string, error)

func GenerateKeyPair

func GenerateKeyPair(bits int) (*rsa.PrivateKey, error)

func GenerateX509CSR

func GenerateX509CSR(key *rsa.PrivateKey, csrDetails CertReqDetails) (string, error)

func GetAWSLambdaServiceCertificate

func GetAWSLambdaServiceCertificate(ztsUrl, domain, service, account, region, ztsAwsDomain string) (tls.Certificate, error)

func GetRoleCertFileName

func GetRoleCertFileName(certDir, fileName, certName string) string

func PrivateKeyFromFile

func PrivateKeyFromFile(filename string) (*rsa.PrivateKey, error)

func PrivatePem

func PrivatePem(privateKey *rsa.PrivateKey) string

func SetupSIADirs

func SetupSIADirs(siaMainDir, siaLinkDir string, sysLogger io.Writer) error

func SplitDomain

func SplitDomain(domain string) (string, string)

func SplitRoleName

func SplitRoleName(roleName string) (string, string, error)

func UidGidForUserGroup

func UidGidForUserGroup(username, groupname string, sysLogger io.Writer) (int, int)

func UpdateFile

func UpdateFile(fileName, contents string, uid, gid int, perm os.FileMode, sysLogger io.Writer) error

func ZtsClient

func ZtsClient(ztsUrl, ztsServerName string, keyFile, certFile, caCertFile string, sysLogger io.Writer) (*zts.ZTSClient, error)

func ZtsHostName

func ZtsHostName(identity, ztsAwsDomain string) string

Types

type CertReqDetails

type CertReqDetails struct {
	CommonName string
	Country    string
	Province   string
	Locality   string
	Org        string
	OrgUnit    string
	IpList     []string
	HostList   []string
	EmailList  []string
	URIs       []*url.URL
}

Jump to

Keyboard shortcuts

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