lxd/db/certificates.go
func (c *Cluster) CertSave(cert *CertInfo) error {
	err := c.Transaction(func(tx *ClusterTx) error {
		stmt, err := tx.tx.Prepare(`
			INSERT INTO certificates (
				fingerprint,
				type,
				name,
				certificate
			) VALUES (?, ?, ?, ?)`,
		)
		if err != nil {
			return err
		}
		defer stmt.Close()
		_, err = stmt.Exec(
			cert.Fingerprint,
			cert.Type,
			cert.Name,
			cert.Certificate,
		)
		if err != nil {
			return err
		}
		return nil
	})
	return err
}
func (c *Cluster) CertSave(cert *CertInfo) error {
	err := c.Transaction(func(tx *ClusterTx) error {
		stmt, err := tx.tx.Prepare(`
			INSERT INTO certificates (
				fingerprint,
				type,
				name,
				certificate
			) VALUES (?, ?, ?, ?)`,
		)
		if err != nil {
			return err
		}
		defer stmt.Close()
		_, err = stmt.Exec(
			cert.Fingerprint,
			cert.Type,
			cert.Name,
			cert.Certificate,
		)
		if err != nil {
			return err
		}
		return nil
	})
	return err
}
// CertSave stores a CertBaseInfo object in the db,
// it will ignore the ID field from the CertInfo.