Documentation ¶
Index ¶
- Constants
- Variables
- func Certificate(args *CertificateArgs) error
- func LoadCertBytes(path string) ([]byte, error)
- func LoadPrivateKey(fileName string) (crypto.Signer, error)
- func LoadPublicKey(fileName string) (crypto.PublicKey, error)
- func WritePEM(block *pem.Block, path string) error
- type CertificateArgs
Constants ¶
View Source
const ( DefaultCertName = "cert.pem" DefaultRootCertName = "rootcert.pem" DefaultKeyName = "key.pem" DefaultRootKeyName = "rootkey.pem" )
Variables ¶
View Source
var ( ErrNoRootCert = errors.New("missing rootCert") ErrNoRootKey = errors.New("missing rootKey") )
View Source
var ( ErrNoPEMBlock = errors.New("no PEM block found") ErrTrailing = errors.New("unexpected trailing data after PEM block") )
Functions ¶
func Certificate ¶
func Certificate(args *CertificateArgs) error
Certificate is used to create a new certificate and private key to sign OS packages with.
func LoadCertBytes ¶ added in v0.3.1
Loads a PEM coded x509 certificate, without decoding the DER blob.
func LoadPrivateKey ¶ added in v0.3.1
Loads a private key file, either x509 style, or an OpenSSH public key file where private key is accessed using ssh-agent.
Types ¶
type CertificateArgs ¶
type CertificateArgs struct { IsCa bool IssuerCertFile string // Empty, for creating a self-signed cert. IssuerKeyFile string // Private root CA signing key. LeafKeyFile string // Public key NotBefore time.Time NotAfter time.Time CertOut string KeyOut string }
CertificateArgs is a list of arguments that's passed to Certificate().
Click to show internal directories.
Click to hide internal directories.