~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta3

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/tools/lxdclient/cert.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
)
17
17
 
18
18
const (
19
 
        tempPrefix = "juju-lxd-"
20
 
 
21
 
        pemBlockTypeCert = "CERTIFICATE"
22
 
        pemBlockTypeKey  = "RSA PRIVATE KEY"
23
 
 
24
19
        certDefaultName = "juju-client-certificate"
25
20
)
26
21
 
61
56
        return cert, nil
62
57
}
63
58
 
64
 
func (cert *Cert) isZero() bool {
65
 
        if cert == nil {
66
 
                return true
67
 
        }
68
 
        return len(cert.CertPEM) == 0 && len(cert.KeyPEM) == 0
69
 
}
70
 
 
71
59
// Validate ensures that the cert is valid.
72
60
func (cert Cert) Validate() error {
73
61
        if len(cert.CertPEM) == 0 {