Documentation ¶
Index ¶
- func AbsPath(base string, path string) string
- func AppendStringIfAbsent(slice *[]string, valueToAdd string) bool
- func AtomicWriteFile(path string, writeFunc func(io.Writer) error, perm FilePerms) error
- func AtomicWriteFileBytes(path string, content []byte, perm FilePerms) error
- func Bindir() string
- func ContainsString(slice []string, value string) bool
- func EllipticCurveFromString(curveName string) (elliptic.Curve, error)
- func EncodeChainPem(writer io.Writer, crts [][]byte) error
- func EncodeCombinedPem(writer io.Writer, privateKey []byte, crts [][]byte) error
- func EncodeJks(rand io.Reader, writer io.Writer, creationDate time.Time, password string, ...) error
- func EncodePem(writer io.Writer, pemType string, bytes []byte) error
- func EncodePkcs12(rand io.Reader, writer io.Writer, password string, privateKeyBytes []byte, ...) error
- func FileContentsAre(path string, content []byte) bool
- func FileExists(path string) bool
- func FormatDuration(value uint, unit string) string
- func FormatMoney(amount uint, currency string) string
- func GetEnvDefault(key string, defaultValue string) string
- func Getfacl(path string) []string
- func Homedir() string
- func Hostname() string
- func IsRoot() bool
- func JoinProse(conj string, items []string) string
- func LinkHeader(h http.Header, rel string) []string
- func NeedsShellQuote(arg string) bool
- func ParseCertificates(certsBytes [][]byte) ([]*x509.Certificate, error)
- func Pluralize(count uint, singular string, plural string) string
- func PrintTable(out io.Writer, table [][]string, columnSeparator string, firstRowIsHeader bool, ...)
- func PromptForBool(message string) (bool, error)
- func PromptForOption(options []string) (int, error)
- func PromptForPassword(message string) (string, error)
- func PromptForString(message string) (string, error)
- func QuoteShellArg(arg string) string
- func QuoteShellArgIfNecessary(arg string) string
- func ReadFileLines(path string) ([]string, error)
- func ReadPemFile(filename string) (*pem.Block, error)
- func ReadPrivateKeyPemFileIfExists(filename string) (*pem.Block, error)
- func RemoveString(slice *[]string, valueToRemove string) bool
- func ReplaceSymlink(symlinkTarget string, symlinkPath string) error
- func ResolveGroupname(groupname string) (int, error)
- func ResolveUsername(username string) (int, error)
- func SelfSignCertificate(key *KeyPair, request *x509.CertificateRequest, notBefore time.Time, ...) ([]byte, error)
- func SetPermissions(path string, perm FilePerms) error
- func SetSaneUmask()
- func Setfacl(path string, facls []string) error
- func SortIdentifiers(a []Identifier)
- func TryReadFile(path string) []byte
- func UniqueStrings(sortedSlice []string) []string
- func UpdateFileContents(path string, content []byte, perm FilePerms) (bool, error)
- func Username() string
- func WriteFileLines(path string, lines []string, perm FilePerms) error
- func WritePemFile(filename string, exclusive bool, fileMode os.FileMode, pemBlock *pem.Block) error
- type FilePerms
- type FilesystemJournal
- type Identifier
- type IdentifierSlice
- type KeyPair
- type KeyType
- func (keytype KeyType) Compare(other KeyType) int
- func (keytype KeyType) HumanString() string
- func (keytype KeyType) MarshalJSON() ([]byte, error)
- func (keytype KeyType) String() string
- func (keytypePtr *KeyType) UnmarshalJSON(data []byte) error
- func (keytype KeyType) X509PublicKeyAlgorithm() x509.PublicKeyAlgorithm
- type SHA256Digest
- func (digest SHA256Digest) Base64() string
- func (digest SHA256Digest) Bytes() []byte
- func (digest SHA256Digest) Compare(other SHA256Digest) int
- func (digest SHA256Digest) Equals(other SHA256Digest) bool
- func (digest SHA256Digest) Hex() string
- func (digest SHA256Digest) MarshalJSON() ([]byte, error)
- func (digest *SHA256Digest) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AtomicWriteFile ¶
func AtomicWriteFileBytes ¶
func EllipticCurveFromString ¶
func EncodeCombinedPem ¶
func EncodeJks ¶
func EncodePkcs12 ¶
func LinkHeader ¶
LinkHeader returns URI-Reference values of all Link headers with relation-type rel. See https://tools.ietf.org/html/rfc5988#section-5 for details. This code is hardly RFC5988 compliant but if it's good enough for the Go developers I guess it's good enough for me?
func ParseCertificates ¶
func ParseCertificates(certsBytes [][]byte) ([]*x509.Certificate, error)
func PrintTable ¶
func ReadPrivateKeyPemFileIfExists ¶
func SelfSignCertificate ¶
func SetSaneUmask ¶
func SetSaneUmask()
func SortIdentifiers ¶
func SortIdentifiers(a []Identifier)
func UpdateFileContents ¶
Types ¶
type FilePerms ¶
type FilesystemJournal ¶
func (*FilesystemJournal) Prepare ¶
func (fs *FilesystemJournal) Prepare(wantedFiles map[string]bool) error
type Identifier ¶
func (*Identifier) AddToRequest ¶
func (identifier *Identifier) AddToRequest(request *x509.CertificateRequest)
func (*Identifier) Compare ¶
func (a *Identifier) Compare(b *Identifier) int
func (*Identifier) DNSName ¶
func (identifier *Identifier) DNSName() string
type IdentifierSlice ¶
type IdentifierSlice []Identifier
func (IdentifierSlice) Len ¶
func (p IdentifierSlice) Len() int
func (IdentifierSlice) Less ¶
func (p IdentifierSlice) Less(i, j int) bool
func (IdentifierSlice) Swap ¶
func (p IdentifierSlice) Swap(i, j int)
type KeyPair ¶
type KeyPair struct {
// contains filtered or unexported fields
}
func MakeKeyPair ¶
func MakeKeyPair(private crypto.PrivateKey) (*KeyPair, error)
func ReadAndParsePrivateKeyPemFileIfExists ¶
func (*KeyPair) Private ¶
func (p *KeyPair) Private() crypto.PrivateKey
func (*KeyPair) PublicSHA256 ¶
func (p *KeyPair) PublicSHA256() SHA256Digest
type KeyType ¶
type KeyType int
func (KeyType) X509PublicKeyAlgorithm ¶
func (keytype KeyType) X509PublicKeyAlgorithm() x509.PublicKeyAlgorithm
type SHA256Digest ¶
type SHA256Digest [32]byte
func Sha256sum ¶
func Sha256sum(data []byte) SHA256Digest
func (SHA256Digest) Base64 ¶
func (digest SHA256Digest) Base64() string
func (SHA256Digest) Bytes ¶
func (digest SHA256Digest) Bytes() []byte
func (SHA256Digest) Compare ¶
func (digest SHA256Digest) Compare(other SHA256Digest) int
func (SHA256Digest) Equals ¶
func (digest SHA256Digest) Equals(other SHA256Digest) bool
func (SHA256Digest) Hex ¶
func (digest SHA256Digest) Hex() string
func (SHA256Digest) MarshalJSON ¶
func (digest SHA256Digest) MarshalJSON() ([]byte, error)
func (*SHA256Digest) UnmarshalJSON ¶
func (digest *SHA256Digest) UnmarshalJSON(data []byte) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.