util

package
v1.10.13 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractServiceName

func ExtractServiceName(tagValues string) (string, string, error)

func FileExists

func FileExists(path string) bool

func GenerateCSR

func GenerateCSR(key *rsa.PrivateKey, countryName, domain, service, commonName, instanceId, provider, spiffeUri, ztsAzureDomain string, principalEmail bool) (string, error)

func GenerateKeyPair

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

func GenerateX509CSR

func GenerateX509CSR(key *rsa.PrivateKey, csrDetails CertReqDetails) (string, 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, ztsAzureDomain 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