util

package
v1.10.36 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const SshSupport = true

Variables

This section is empty.

Functions

func Copy added in v1.10.14

func Copy(sourceFile, destFile string, perm os.FileMode) error

func CopyCertKeyFile added in v1.10.14

func CopyCertKeyFile(srcKey, destKey, srcCert, destCert string, keyPerm int) error

func EnsureBackUpDir added in v1.10.14

func EnsureBackUpDir(backUpDir string) error

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 NewSysLogger added in v1.10.14

func NewSysLogger() (io.Writer, error)

func PrivateKey added in v1.10.14

func PrivateKey(keyFile string, rotateKey bool) (*rsa.PrivateKey, error)

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 SvcAttrs added in v1.10.14

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

func UidGidForUserGroup

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

func UpdateFile

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

func UpdateKey added in v1.10.14

func UpdateKey(keyFile string, uid, gid int)

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