Documentation ¶
Index ¶
Constants ¶
const ( CACertAndKeyBaseName = "ca" ServerCertBaseName = "server" QemuServerCertCommonName = "qemu-server" ClientCertBaseName = "client" QemuClientCertCommonName = "qemu-client" )
const ( CA_CERT_NAME = "ca-cert.pem" CA_KEY_NAME = "ca-key.pem" SERVER_CERT_NAME = "server-cert.pem" SERVER_KEY_NAME = "server-key.pem" CLIENT_CERT_NAME = "client-cert.pem" CLIENT_KEY_NAME = "client-key.pem" )
Variables ¶
var ( QemuCertRootCA = QemuCert{ Name: "ca", LongName: "self-signed CA to provision identities for other qemu actions", BaseName: CACertAndKeyBaseName, // contains filtered or unexported fields } QemuCertServer = QemuCert{ Name: "server", LongName: "certificate for server", BaseName: ServerCertBaseName, CAName: "ca", // contains filtered or unexported fields } QemuCertClient = QemuCert{ Name: "client", LongName: "certificate for the server to connect to client", BaseName: ClientCertBaseName, CAName: "ca", // contains filtered or unexported fields } )
Functions ¶
Types ¶
type CertificateMap ¶
CertificateMap is a flat map of certificates, keyed by Name.
func (CertificateMap) CertTree ¶
func (m CertificateMap) CertTree() (CertificateTree, error)
CertTree returns a one-level-deep tree, mapping a CA cert to an array of certificates that should be signed by it.
type CertificateTree ¶
type CertificateTree map[*QemuCert]Certificates
CertificateTree is represents a one-level-deep tree, mapping a CA to the certs that depend on it.
func (CertificateTree) CreateTree ¶
func (t CertificateTree) CreateTree(dir string) error
CreateTree creates the CAs, certs signed by the CAs, and writes them all to disk.
type Certificates ¶
type Certificates []*QemuCert
Certificates is a list of Certificates that should be created
func GetDefaultCertList ¶
func GetDefaultCertList() Certificates
GetDefaultCertList returns all of the certificates qemu requires.
func (Certificates) AsMap ¶
func (c Certificates) AsMap() CertificateMap
type QemuCert ¶
type QemuCert struct { Name string LongName string BaseName string CAName string // contains filtered or unexported fields }
QemuCert represents a cretificate that qemu required.
func (*QemuCert) CreateAsCA ¶
CreateAsCA creates a certificate authority, writing the files to disk and also returning the created CA so it can be used to sign child certs.
func (*QemuCert) CreateFromCA ¶
CreateFromCA makes and writes a certificate using the given CA cert and key.