// Obtain tries to obtain a single certificate using all domains passed into it.
//
// This function will never return a partial certificate.
// If one domain in the list fails, the whole certificate will fail.
346266
func (c *Certifier) Obtain(request ObtainRequest) (*Resource, error) {
	if len(request.Domains) == 0 {
		return nil, errors.New("no domains to obtain a certificate for")
	}

	domains := sanitizeDomain(request.Domains)

	if request.Bundle {
		log.Infof("[%s] acme: Obtaining bundled SAN certificate", strings.Join(domains, ", "))
	} else {
		log.Infof("[%s] acme: Obtaining SAN certificate", strings.Join(domains, ", "))
	}

	order, err := c.core.Orders.New(domains)
	if err != nil {
		return nil, err
	}

	authz, err := c.getAuthorizations(order)
	if err != nil {
		// If any challenge fails, return. Do not generate partial SAN certificates.
		c.deactivateAuthorizations(order)
		return nil, err
	}

	err = c.resolver.Solve(authz)
	if err != nil {
		// If any challenge fails, return. Do not generate partial SAN certificates.
		c.deactivateAuthorizations(order)
		return nil, err
	}

	log.Infof("[%s] acme: Validations succeeded; requesting certificates", strings.Join(domains, ", "))

	failures := make(obtainError)
	cert, err := c.getForOrder(domains, order, request.Bundle, request.PrivateKey, request.MustStaple)
	if err != nil {
		for _, auth := range authz {
			failures[challenge.GetTargetedDomain(auth)] = err
		}
	}

	// Do not return an empty failures map, because
	// it would still be a non-nil error value
	if len(failures) > 0 {
		return cert, failures
	}
	return cert, nil
}
683669
func (pool *AccPool) Obtain(p int) *DictAcceptor {
	if pool.i >= len(pool.acc) {
		pool.acc = append(pool.acc, DictAcceptor{})
	}

	a := &pool.acc[pool.i]
	a.Reset(p)
	pool.i++
	return a
}
786727
func (f *fsClient) Get(sse encrypt.ServerSide) (io.ReadCloser, *probe.Error) {
	return f.get()
}
596980
func (u Uint32) Get() (uint32, error) {
	if !u.Present() {
		var zero uint32
		return zero, errors.New("value not present")
	}
	return *u.value, nil
}
651955
func (c *Connection) Get(property string) (interface{}, error) {
	value, err := c.Call("get_property", property)
	return value, err
}
516530
func (r *ShardedTTL) Get(tenantID, key string) (interface{}, error) {
	r.Lock()
	defer r.Unlock()

	if !r.isValid(tenantID, key) {
		r.delete(tenantID, key)
		return nil, ErrNotFound
	}

	value, err := r.cache.Get(tenantID, key)
	if err != nil {
		return nil, err
	}

	return value, nil
}
523727
func (b blobStoreVerifier) Get(ctx context.Context, dgst digest.Digest) ([]byte, error) {
	data, err := b.BlobStore.Get(ctx, dgst)
	if err != nil {
		return nil, err
	}
	if len(dgst) > 0 {
		dataDgst := dgst.Algorithm().FromBytes(data)
		if dataDgst != dgst {
			return nil, fmt.Errorf("content integrity error: the blob retrieved with digest %s does not match the digest calculated from the content %s", dgst, dataDgst)
		}
	}
	return data, nil
}
647590
func (c *securityContextConstraints) Get(name string, options v1.GetOptions) (result *security.SecurityContextConstraints, err error) {
	result = &security.SecurityContextConstraints{}
	err = c.client.Get().
		Resource("securitycontextconstraints").
		Name(name).
		VersionedParams(&options, scheme.ParameterCodec).
		Do().
		Into(result)
	return
}
1248099
func (_m *RequesterVariadic) Get(values ...string) bool {
	_va := make([]interface{}, len(values))
	for _i := range values {
		_va[_i] = values[_i]
	}
	var _ca []interface{}
	_ca = append(_ca, _va...)
	ret := _m.Called(_ca...)

	var r0 bool
	if rf, ok := ret.Get(0).(func(...string) bool); ok {
		r0 = rf(values...)
	} else {
		r0 = ret.Get(0).(bool)
	}

	return r0
}
169684
func (s *FilesystemStore) Get(r *http.Request, name string) (*Session, error) {
	return GetRegistry(r).Get(s, name)
}
121306
func (*Instances) Get(c context.Context, req *instances.GetRequest) (*instances.Instance, error) {
	switch {
	case req.GetId() == "" && req.GetHostname() == "":
		return nil, status.Errorf(codes.InvalidArgument, "ID or hostname is required")
	case req.Id != "" && req.Hostname != "":
		return nil, status.Errorf(codes.InvalidArgument, "exactly one of ID or hostname is required")
	case req.Id != "":
		return getByID(c, req.Id)
	default:
		return getByHostname(c, req.Hostname)
	}
}
430522
func (h Secretservice) Get(serverURL string) (string, string, error) {
	if serverURL == "" {
		return "", "", errors.New("missing server url")
	}
	var username *C.char
	defer C.free(unsafe.Pointer(username))
	var secret *C.char
	defer C.free(unsafe.Pointer(secret))
	server := C.CString(serverURL)
	defer C.free(unsafe.Pointer(server))

	err := C.get(server, &username, &secret)
	if err != nil {
		defer C.g_error_free(err)
		errMsg := (*C.char)(unsafe.Pointer(err.message))
		return "", "", errors.New(C.GoString(errMsg))
	}
	user := C.GoString(username)
	pass := C.GoString(secret)
	if pass == "" {
		return "", "", credentials.NewErrCredentialsNotFound()
	}
	return user, pass, nil
}
497063
func (c *FakeSecurityContextConstraints) Get(name string, options v1.GetOptions) (result *security.SecurityContextConstraints, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootGetAction(securitycontextconstraintsResource, name), &security.SecurityContextConstraints{})
	if obj == nil {
		return nil, err
	}
	return obj.(*security.SecurityContextConstraints), err
}
5946
func (c *Credentials) Get() (Value, error) {
	c.m.Lock()
	defer c.m.Unlock()
	return c.provider.Retrieve()
}
389039
func (r *REST) Get(ctx context.Context, _ string, options runtime.Object) (runtime.Object, error) {
	listOptions, ok := options.(*metav1.ListOptions)
	if !ok {
		return nil, fmt.Errorf("unexpected options: %T", options)
	}
	var opts metav1.ListOptions
	if listOptions != nil {
		opts = *listOptions
	}
	ns, ok := apirequest.NamespaceFrom(ctx)
	if !ok {
		ns = metav1.NamespaceAll
	}
	secrets, err := r.secrets.Secrets(ns).List(opts)
	if err != nil {
		return nil, err
	}
	filtered := make([]coreapi.Secret, 0, len(secrets.Items))
	for i := range secrets.Items {
		if secrets.Items[i].Annotations[imageapi.ExcludeImageSecretAnnotation] == "true" {
			continue
		}
		switch secrets.Items[i].Type {
		case corev1.SecretTypeDockercfg, corev1.SecretTypeDockerConfigJson:
			internalSecret := &coreapi.Secret{}
			if err := corev1conversion.Convert_v1_Secret_To_core_Secret(&secrets.Items[i], internalSecret, nil); err != nil {
				return nil, err
			}
			filtered = append(filtered, *internalSecret)
		}
	}
	// clear the external content and convert
	secrets.Items = nil
	internalSecretList := &coreapi.SecretList{}
	if err := corev1conversion.Convert_v1_SecretList_To_core_SecretList(secrets, internalSecretList, nil); err != nil {
		return nil, err
	}
	internalSecretList.Items = filtered
	return internalSecretList, nil
}
564283
func (h Osxkeychain) Get(serverURL string) (string, string, error) {
	s, err := splitServer(serverURL)
	if err != nil {
		return "", "", err
	}
	defer freeServer(s)

	var usernameLen C.uint
	var username *C.char
	var secretLen C.uint
	var secret *C.char
	defer C.free(unsafe.Pointer(username))
	defer C.free(unsafe.Pointer(secret))

	errMsg := C.keychain_get(s, &usernameLen, &username, &secretLen, &secret)
	if errMsg != nil {
		defer C.free(unsafe.Pointer(errMsg))
		goMsg := C.GoString(errMsg)
		if goMsg == errCredentialsNotFound {
			return "", "", credentials.NewErrCredentialsNotFound()
		}

		return "", "", errors.New(goMsg)
	}

	user := C.GoStringN(username, C.int(usernameLen))
	pass := C.GoStringN(secret, C.int(secretLen))
	return user, pass, nil
}
599899
func Get(cert *x509.Certificate) (*Constraints, error) {
	certs, err := x509.ParseCertificates(cert.Raw)
	if err != nil {
		return nil, err
	}
	if len(certs) != 1 {
		return nil, fmt.Errorf("cert.Raw must contain exactly one certificate")
	}
	constraintCert := certs[0]

	return &Constraints{
		PermittedDNSDomains: constraintCert.PermittedDNSDomains,
		ExcludedDNSDomains:  constraintCert.ExcludedDNSDomains,
		PermittedIPRanges:   constraintCert.PermittedIPRanges,
		ExcludedIPRanges:    constraintCert.ExcludedIPRanges,
	}, nil
}