// Subjects returns a list of the DER-encoded subjects of
// all of the certificates in the pool.
439685
func (s *CertPool) Subjects() [][]byte {
	res := make([][]byte, len(s.certs))
	for i, c := range s.certs {
		res[i] = c.RawSubject
	}
	return res
}
1267020
func (p SubjectPath) Subject(e *Entity) (string, error) {
	var next Object = e
	var prev *Entity
	var item string
	for _, item = range p {
		ent, ok := next.(*Entity)
		if !ok {
			return "", errors.Errorf("can't get '%v' out of non-entity %#v.", item, next)
		}
		prev = ent
		next = ent.Objects[Property(item)]
	}
	delete(prev.Objects, Property(item)) // remove the subject from the entity so that it isn't indexed
	switch next.(type) {
	case I, I8, I16, I32, I64, U, U8, U16, U32, U64:
		return fmt.Sprintf("%d", next), nil
	case F32, F64:
		return fmt.Sprintf("%f", next), nil
	case S:
		return string(next.(S)), nil
	default:
		return "", fmt.Errorf("can't make %v of type %T an IRI", next, next)
	}
}
54385
func ReadCertificates(in []byte) (certs []*x509.Certificate, err error) {
	var cert *x509.Certificate
	for {
		cert, in, err = ReadCertificate(in)
		if err != nil {
			break
		}

		if cert == nil {
			break
		}

		certs = append(certs, cert)
		if len(in) == 0 {
			break
		}
	}

	return certs, err
}
199206
func List(c *deis.Client, results int) ([]api.Cert, int, error) {
	body, count, reqErr := c.LimitedRequest("/v2/certs/", results)

	if reqErr != nil && !deis.IsErrAPIMismatch(reqErr) {
		return []api.Cert{}, -1, reqErr
	}

	var res []api.Cert
	if err := json.Unmarshal([]byte(body), &res); err != nil {
		return []api.Cert{}, -1, err
	}

	return res, count, reqErr
}
121991
func (s *LocalStore) SaveCertificates(certificates []*Certificate) error {
	storedData, err := s.get()
	if err != nil {
		return err
	}

	storedData.Certificates = certificates
	s.SaveDataChan <- storedData

	return nil
}
1123588
func (api *ProxyLBAPI) GetCertificates(id int64) (*sacloud.ProxyLBCertificates, error) {
	var (
		method = "GET"
		uri    = fmt.Sprintf("%s/%d/proxylb/sslcertificate", api.getResourceURL(), id)
		res    = &proxyLBCertificateResponse{}
	)
	err := api.baseAPI.request(method, uri, nil, res)
	if err != nil {
		return nil, err
	}
	if res.ProxyLB == nil {
		return nil, nil
	}
	return res.ProxyLB, nil
}
605938
func (b *BigIP) Certificates() (*Certificates, error) {
	var certs Certificates
	err, _ := b.getForEntity(&certs, uriSys, uriFile, uriSslCert)
	if err != nil {
		return nil, err
	}

	return &certs, nil
}
612731
func (c *FakeCertificateSigningRequests) List(opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestList, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootListAction(certificatesigningrequestsResource, certificatesigningrequestsKind, opts), &v1beta1.CertificateSigningRequestList{})
	if obj == nil {
		return nil, err
	}

	label, _, _ := testing.ExtractFromListOptions(opts)
	if label == nil {
		label = labels.Everything()
	}
	list := &v1beta1.CertificateSigningRequestList{ListMeta: obj.(*v1beta1.CertificateSigningRequestList).ListMeta}
	for _, item := range obj.(*v1beta1.CertificateSigningRequestList).Items {
		if label.Matches(labels.Set(item.Labels)) {
			list.Items = append(list.Items, item)
		}
	}
	return list, err
}
687478
func (Signer) Certificates(c context.Context) (*signing.PublicCertificates, error) {
	return getCachedCerts(c)
}
708890
func diffSubjectLists(list1 []rbacv1.Subject, list2 []rbacv1.Subject) (list1Only []rbacv1.Subject, list2Only []rbacv1.Subject) {
	for _, list1Item := range list1 {
		if !contains(list2, list1Item) {
			if !contains(list1Only, list1Item) {
				list1Only = append(list1Only, list1Item)
			}
		}
	}
	for _, list2Item := range list2 {
		if !contains(list1, list2Item) {
			if !contains(list2Only, list2Item) {
				list2Only = append(list2Only, list2Item)
			}
		}
	}
	return
}
1162404
func Convert_v1_Subject_To_rbac_Subject(in *v1.Subject, out *rbac.Subject, s conversion.Scope) error {
	return autoConvert_v1_Subject_To_rbac_Subject(in, out, s)
}
1250726
func (ge *GobEncoder) Encode(subject string, v interface{}) ([]byte, error) {
	b := new(bytes.Buffer)
	enc := gob.NewEncoder(b)
	if err := enc.Encode(v); err != nil {
		return nil, err
	}
	return b.Bytes(), nil
}
1232234
func Convert_v1beta1_Subject_To_rbac_Subject(in *v1beta1.Subject, out *rbac.Subject, s conversion.Scope) error {
	return autoConvert_v1beta1_Subject_To_rbac_Subject(in, out, s)
}
1169356
func (c *Client) Rels(req *Request, value interface{}) (hypermedia.Relations, *Response) {
	if rels, ok := c.Cacher.Rels(req.Request); ok {
		return rels, &Response{}
	}

	res := req.Get()
	res.Decode(value)

	return hypermedia.Rels(value), res
}
906598
func (in *Subject) DeepCopy() *Subject {
	if in == nil {
		return nil
	}
	out := new(Subject)
	in.DeepCopyInto(out)
	return out
}
879472
func (id *Identity) Subject() pkix.Name {
	subject := pkix.Name{
		CommonName: id.Username,
	}
	subject.Organization = append([]string{}, id.Groups...)
	subject.OrganizationalUnit = append([]string{}, id.Usage...)
	subject.Locality = append([]string{}, id.Principals...)
	subject.Province = append([]string{}, id.KubernetesGroups...)
	return subject
}
269970
func (m *MailYak) Subject(sub string) {
	m.subject = mime.QEncoding.Encode("UTF-8", m.trimRegex.ReplaceAllString(sub, ""))
}