Validate a key

        :param key_path: path to a key to use for authentication
        :type key_path: str

        :return: key object used for authentication
        :rtype: paramiko.RSAKey
183620
def validate_key(key_path):
    

    key_path = os.path.expanduser(key_path)

    if not os.path.isfile(key_path):
        return False

    return paramiko.RSAKey.from_private_key_file(key_path)
460552
def get_key_from_request(self):
        '''
        '''

        path = "result:%s" % self.context.request.url

        if self.is_auto_webp():
            path += '/webp'

        return path
1059349
def validate_path_to_api_path(path, paths, basePath='', context=None, **kwargs):
    
    if context is None:
        context = {}
    try:
        api_path = match_path_to_api_path(
            path_definitions=paths,
            target_path=path,
            base_path=basePath,
            context=context,
        )
    except LookupError as err:
        raise ValidationError(str(err))
    except MultiplePathsFound as err:
        raise ValidationError(str(err))

    return api_path
24706
def value_for_keypath(obj, path):
    
    val = obj
    for part in path.split('.'):
        match = re.match(list_index_re, part)
        if match is not None:
            val = _extract(val, match.group(1))
            if not isinstance(val, list) and not isinstance(val, tuple):
                raise TypeError('expected list/tuple')
            index = int(match.group(2))
            val = val[index]
        else:
            val = _extract(val, part)
        if val is None:
            return None
    return val
553979
def get_key(key_name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        key = conn.get_key_pair(key_name)
        log.debug("the key to return is : %s", key)
        if key is None:
            return False
        return key.name, key.fingerprint
    except boto.exception.BotoServerError as e:
        log.debug(e)
        return False
342328
function toKeyPath (path) {
  if (!ktypes.isArray(path)) {
    path = [path]
  }
  return _.map(path, function (key) {
    return ktypes.toString(key)
  })
}
1074344
def check_key_cert_match(keyfile, certfile):
    
    key_modulus = subprocess.check_output(
        'openssl rsa -noout -modulus -in {}'.format(keyfile),
        shell=True)
    cert_modulus = subprocess.check_output(
        'openssl x509 -noout -modulus -in {}'.format(certfile),
        shell=True)
    return key_modulus == cert_modulus
1156492
def _get_pkey(self):
        """"""
        keypath = self.config.server["pkey"]
        with open(os.path.expanduser(keypath)) as f:
            pkey = paramiko.RSAKey.from_private_key(f)

        return pkey
383175
def load_key(self, path):
        
        with open(path, 'r') as f:
            self.key = f.readline().strip()
            self.secret = f.readline().strip()
1078634
def _validate_path(path):
    
    if path is None:
        return None

    new_path = np.array(sorted(set(path), reverse=True))
    if new_path[0] != path[0]:
        print("Warning: Path must be sorted largest to smallest.")

    return new_path
400995
def validate_key(key)
      unless key.is_a?(Symbol) || key.is_a?(String)
        raise ArgumentError, 'Key must be a string or symbol'
      end
      key
    end
178217
def authenticate_key(api_key):
    
    user_model = Query()
    user = db.search(user_model.api_key == api_key)[0]
    if user:
        return user['username']
    return False
459341
def validate_keys(self):
        
        url = 'https://api.twitter.com/1.1/account/verify_credentials.json'

        keys_present = self.consumer_key and self.consumer_secret and \
                       self.access_token and self.access_token_secret

        if keys_present:
            try:
                # Need to explicitly reconnect to confirm the current creds
                # are used in the session object.
                self.connect()
                self.get(url)
            except requests.HTTPError as e:
                if e.response.status_code == 401:
                    raise RuntimeError('Invalid credentials provided.')
                else:
                    raise e
        else:
            raise RuntimeError('Incomplete credentials provided.')
8203
def query_key(path)
      i = 0
      path.map do |v|
        i += 1
        if i != 1
          "[#{v}]"
        else
          v
        end
      end.join('')
    end
166644
def _check_valid_key(self, key):
        
        if not isinstance(key, key_type):
            raise ValueError('%r is not a valid key type' % key)
        if not VALID_KEY_RE.match(key):
            raise ValueError('%r contains illegal characters' % key)
1084671
def from_private_key(path: str) -> SigningKeyType:
        
        key = load_key(path)
        key.pubkey = Base58Encoder.encode(key.vk)
        return key
118112
def load_rsa_key(rsa_keypath)
      File.open(rsa_keypath, 'r') do |file|
        rsa_key = nil
        rsa_key = [file.read]
        if !rsa_key.nil?
          FastlaneCore::UI.success('Successfully loaded RSA key...')
        else
          FastlaneCore::UI.user_error!('Failed to load RSA key...')
        end
        rsa_key
      end
    end