GET /auth/<mount_point>/config/certificate/<cert_name>

        :param cert_name:
        :type cert_name:
        :param mount_point:
        :type mount_point:
        :return:
        :rtype:
969837
def get_vault_ec2_certificate_configuration(self, cert_name, mount_point='aws-ec2'):
        
        return self._adapter.get('/v1/auth/{0}/config/certificate/{1}'.format(mount_point, cert_name)).json()
751136
def cert_pair(self):
        
        if self._ssl_cert and self._ssl_private_key:
            return (self._ssl_cert, self._ssl_private_key)
        else:
            return None
1167402
def mount_point(self):
        
        if self._mount_point is None:
            cmd_create = ["podman", "create", self.target_name, "some-cmd"]
            self._mounted_container_id = subprocess.check_output(cmd_create).decode().rstrip()
            cmd_mount = ["podman", "mount", self._mounted_container_id]
            self._mount_point = subprocess.check_output(cmd_mount).decode().rstrip()
        return self._mount_point
960648
def matches_hostname(cls, certificate: cryptography.x509.Certificate, hostname: str) -> None:
        
        # Extract the names from the certificate to create the properly-formatted dictionary
        certificate_names = {
            'subject': (tuple([('commonName', name) for name in cls.get_common_names(certificate.subject)]),),
            'subjectAltName': tuple([('DNS', name) for name in cls.get_dns_subject_alternative_names(certificate)]),
        }
        # CertificateError is raised on failure
        ssl.match_hostname(certificate_names, hostname)
709497
def parse_client_cert_pair(config_value):
    
    if not config_value:
        return
    client_cert = config_value.split(':')
    if len(client_cert) != 2:
        tips = ('client_cert should be formatted like '
                '"/path/to/cert.pem:/path/to/key.pem"')
        raise ValueError('{0!r} is invalid.\n{1}'.format(config_value, tips))
    return tuple(client_cert)
1236527
def get_session(username, password, default_endpoints=clc.defaults, cert=None):
	
	if cert is None:
		cert = API._ResourcePath('clc/cacert.pem')

	session = requests.Session()

	request = session.request(
		"POST",
		"{}/v2/authentication/login".format(default_endpoints.ENDPOINT_URL_V2),
		data={"username": username, "password": password},
		verify=cert)

	data = request.json()

	if request.status_code == 200:
		token = data['bearerToken']
		alias = data['accountAlias']
		location = data['locationAlias']
	elif request.status_code == 400:
		raise Exception("Invalid V2 API login. {}".format(data['message']))
	else:
		raise Exception("Error logging into V2 API.  Response code {}. message {}"
					    .format(request.status_code,data['message']))

	return {'username': username,
			'password': password,
			'http_session': session,
			'token': token,
			'alias': alias,
			'location': location}
28376
def __get_request_auth(username, password):
    '''
    
    '''

    # pylint: disable=unused-argument
    def __request_auth(credentials, user_data):
        '''Callback method passed to libvirt.openAuth().

        The credentials argument is a list of credentials that libvirt
        would like to request. An element of this list is a list containing
        5 items (4 inputs, 1 output):
          - the credential type, e.g. libvirt.VIR_CRED_AUTHNAME
          - a prompt to be displayed to the user
          - a challenge
          - a default result for the request
          - a place to store the actual result for the request

        The user_data argument is currently not set in the openAuth call.
        '''
        for credential in credentials:
            if credential[0] == libvirt.VIR_CRED_AUTHNAME:
                credential[4] = username if username else \
                                __salt__['config.get']('virt:connection:auth:username', credential[3])
            elif credential[0] == libvirt.VIR_CRED_NOECHOPROMPT:
                credential[4] = password if password else \
                                __salt__['config.get']('virt:connection:auth:password', credential[3])
            else:
                log.info('Unhandled credential type: %s', credential[0])
        return 0
94688
def new_mountpoint(self, name):
        """"""
        url = posixpath.join(self.path, name)
        r = self._jfs.post(url, extra_headers={'content-type': 'application/x-www-form-urlencoded'})
        return r
1330567
def _retrieveRemoteCertificate(self, From, port=port):
        
        CS = self.service.certificateStorage
        host = str(From.domainAddress())
        p = AMP()
        p.wrapper = self.wrapper
        f = protocol.ClientCreator(reactor, lambda: p)
        connD = f.connectTCP(host, port)

        def connected(proto):
            dhost = From.domainAddress()
            iddom = proto.callRemote(Identify, subject=dhost)
            def gotCert(identifyBox):
                theirCert = identifyBox['certificate']
                theirIssuer = theirCert.getIssuer().commonName
                theirName = theirCert.getSubject().commonName
                if (theirName != str(dhost)):
                    raise VerifyError(
                        "%r claimed it was %r in IDENTIFY response"
                        % (theirName, dhost))
                if (theirIssuer != str(dhost)):
                    raise VerifyError(
                        "self-signed %r claimed it was issued by "
                        "%r in IDENTIFY response" % (dhost, theirIssuer))
                def storedCert(ignored):
                    return theirCert
                return CS.storeSelfSignedCertificate(
                    str(dhost), theirCert).addCallback(storedCert)
            def nothingify(x):
                proto.transport.loseConnection()
                return x
            return iddom.addCallback(gotCert).addBoth(nothingify)
        connD.addCallback(connected)
        return connD
1367104
def get_role_secret_id(self, role_name, secret_id, mount_point='approle'):
        
        url = '/v1/auth/{0}/role/{1}/secret-id/lookup'.format(mount_point, role_name)
        params = {
            'secret_id': secret_id
        }
        return self._adapter.post(url, json=params).json()
374005
def ssl_options(self):
        
        opts = self.namespace.server.get(config.SSL_OPTIONS) or dict()
        if config.CERT_REQS in opts:
            opts[config.CERT_REQS] = \
                self.CERT_REQUIREMENTS[opts[config.CERT_REQS]]
        return opts or None
931962
def transit_read_key(self, name, mount_point='transit'):
        
        url = '/v1/{0}/keys/{1}'.format(mount_point, name)
        return self._adapter.get(url).json()
557536
def _get_client_side_certificate_subject():
    
    subject = django.core.cache.cache.get('client_side_certificate_subject')
    if subject is not None:
        return subject
    cert_pem = _get_client_side_certificate_pem()
    if cert_pem is None:
        return None
    subject = _extract_subject_from_pem(cert_pem)
    django.core.cache.cache.set('client_side_certificate_subject', subject)
    return subject
660155
def read_mount_cache(name):
    '''
    
    '''
    cache = salt.utils.mount.read_cache(__opts__)
    if cache:
        if 'mounts' in cache and cache['mounts']:
            if name in cache['mounts']:
                return cache['mounts'][name]
    return {}
509145
def RegisterMountPoint(cls, mount_point, path_spec):
    
    if mount_point in cls._mount_points:
      raise KeyError('Mount point: {0:s} already set.'.format(mount_point))

    cls._mount_points[mount_point] = path_spec
1313801
def getCert(username, password,
            certHost=_SERVER,
            certfile=None,
            certQuery=_PROXY):
    """"""

    if certfile is None:
        certfile = tempfile.NamedTemporaryFile()

    # Add the username and password.
    # If we knew the realm, we could use it instead of ``None``.
    password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
    top_level_url = "http://" + certHost
    logging.debug(top_level_url)
    password_mgr.add_password(None, top_level_url, username, password)
    handler = urllib2.HTTPBasicAuthHandler(password_mgr)
    logging.debug(str(handler))
    # create "opener" (OpenerDirector instance)
    opener = urllib2.build_opener(handler)

    # Install the opener.   
    urllib2.install_opener(opener)

    # buuld the url that with 'GET' a certificat using user_id/password info
    url = "http://" + certHost + certQuery
    logging.debug(url)

    r = None
    try:
        r = opener.open(url)
    except urllib2.HTTPError as e:
        logging.debug(url)
        logging.debug(str(e))
        return False

    logging.debug(str(r))

    if r is not None:
        while True:
            buf = r.read()
            logging.debug(buf)
            if not buf:
                break
            certfile.write(buf)
        r.close()

    return certfile
278339
def delete_server_cert(cert_name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    try:
        return conn.delete_server_cert(cert_name)
    except boto.exception.BotoServerError as e:
        log.debug(e)
        log.error('Failed to delete certificate %s.', cert_name)
        return False