func (creds *Credentials) Cert() (cert *Certificate, err error) {
	if creds.Certificate == "" {
		return
	}
	cert = new(Certificate)
	err = json.Unmarshal([]byte(creds.Certificate), cert)
	return
}
func (creds *Credentials) Cert() (cert *Certificate, err error) {
	if creds.Certificate == "" {
		return
	}
	cert = new(Certificate)
	err = json.Unmarshal([]byte(creds.Certificate), cert)
	return
}
// Cert attempts to parse the certificate string to return it as an object. If
// the certificate is an empty string (e.g. in the case of permanent
// credentials) then a nil pointer is returned for the certificate. If a
// certificate has been specified but cannot be parsed, an error is returned,
// and cert is an empty certificate (rather than nil).