fetch and decrypt the secret called `name`
767584
def getSecret(name, version="", region=None,
              table="credential-store", context=None,
              dynamodb=None, kms=None, **kwargs):
    '''
    
    '''
    if not context:
        context = {}

    # Can we cache
    if dynamodb is None or kms is None:
        session = get_session(**kwargs)
        if dynamodb is None:
            dynamodb = session.resource('dynamodb', region_name=region)
        if kms is None:
            kms = session.client('kms', region_name=region)

    secrets = dynamodb.Table(table)

    if version == "":
        # do a consistent fetch of the credential with the highest version
        response = secrets.query(Limit=1,
                                 ScanIndexForward=False,
                                 ConsistentRead=True,
                                 KeyConditionExpression=boto3.dynamodb.conditions.Key("name").eq(name))
        if response["Count"] == 0:
            raise ItemNotFound("Item {'name': '%s'} couldn't be found." % name)
        material = response["Items"][0]
    else:
        response = secrets.get_item(Key={"name": name, "version": version})
        if "Item" not in response:
            raise ItemNotFound(
                "Item {'name': '%s', 'version': '%s'} couldn't be found." % (name, version))
        material = response["Item"]

    key_service = KeyService(kms, None, context)

    return open_aes_ctr_legacy(key_service, material)
810923
def _update_secret(namespace, name, data, apiserver_url):
    ''''''
    # Prepare URL
    url = "{0}/api/v1/namespaces/{1}/secrets/{2}".format(apiserver_url,
                                                         namespace, name)
    # Prepare data
    data = [{"op": "replace", "path": "/data", "value": data}]
    # Make request
    ret = _kpatch(url, data)
    if ret.get("status") == 404:
        return "Node {0} doesn't exist".format(url)
    return ret
407217
def get_common_secret(self, server_public, client_public):
        
        return self.hash(self.pad(client_public), self.pad(server_public))
1351349
def _key_digest(self, secret_key):
        
        '''
            
        '''
        
        from hashlib import md5, sha256
        from base64 import b64encode
        key_bytes = sha256(secret_key.encode('utf-8')).digest()
        key_b64 = b64encode(key_bytes).decode()
        digest_bytes = md5(key_bytes).digest()
        digest_b64 = b64encode(digest_bytes).decode()
        
        return key_b64, digest_b64
1208356
def hkeys(self, name):
        
        with self.pipe as pipe:
            f = Future()
            res = pipe.hkeys(self.redis_key(name))

            def cb():
                m_decode = self.memberparse.decode
                f.set([m_decode(v) for v in res.result])

            pipe.on_execute(cb)
            return f
1333405
def secret(self, s):
        
        s = parseable_str(s)
        for f in [self.private_key, self.hierarchical_key]:
            v = f(s)
            if v:
                return v
1139948
def get_secret(key, *args, **kwargs):
    """"""
    env_value = os.environ.get(key.replace('.', '_').upper())
    if not env_value:
        # Backwards compatibility: the deprecated secrets vault
        return _get_secret_from_vault(key, *args, **kwargs)
    return env_value
228977
def decode(self, name, as_map_key=False):
        """"""
        if is_cache_key(name) and (name in self.key_to_value):
            return self.key_to_value[name]
        return self.encache(name) if is_cacheable(name, as_map_key) else name
295687
public static function get($name)
    {
        if (!self::isExist($name)) return false;
        $value = $_COOKIE[Config::get('cookie_prefix') . $name];
        return Encry::decrypt($value);
    }
178101
def get_cookie(self, key, secret=None):
        
        value = self.COOKIES.get(key)
        if secret and value:
            dec = cookie_decode(value, secret) # (key, value) tuple or None
            return dec[1] if dec and dec[0] == key else None
        return value or None
444681
def decrypt(secret, modN, d, blockSize):
    """"""
    numBlocks = [modExp(blocks, d, modN) for blocks in secret]
    numList = blocks2numList(numBlocks, blockSize)
    return numList2string(numList)
1000228
def decrypt(data, key):
    ''''''
    data_len = len(data)
    data = ffi.from_buffer(data)
    key = ffi.from_buffer(__tobytes(key))
    out_len = ffi.new('size_t *')
    result = lib.xxtea_decrypt(data, data_len, key, out_len)
    ret = ffi.buffer(result, out_len[0])[:]
    lib.free(result)
    return ret
715975
def get_password_hash(username):
    
    try:
        h = spwd.getspnam(username)
    except KeyError:
        return None

    # mitogen.core.Secret() is a Unicode subclass with a repr() that hides the
    # secret data. This keeps secret stuff out of logs. Like blobs, secrets can
    # also be serialized.
    return mitogen.core.Secret(h)
182026
def read(path, options = {})
      headers = extract_headers!(options)
      json = client.get("/v1/#{encode_path(path)}", {}, headers)
      return Secret.decode(json)
    rescue HTTPError => e
      return nil if e.code == 404
      raise
    end
6816
def get_name(self, key):
        '''
        '''
        try:
            return self.nameDict[key]
        except IndexError as e:
            print 'IndexError {0}: {1}'.format(e.errno, e.strerror)
1087124
def get_secret
      if Jiralicious.oauth_secret.nil?
        IO.read(Jiralicious.config_path + Jiralicious.oauth_secret_filename)
      else
        Jiralicious.oauth_secret
      end
    end
624004
def decrypt(ciphertext_blob, encryption_context=None, grant_tokens=None,
            region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    r = {}
    try:
        plaintext = conn.decrypt(
            ciphertext_blob,
            encryption_context=encryption_context,
            grant_tokens=grant_tokens
        )
        r['plaintext'] = plaintext['Plaintext']
    except boto.exception.BotoServerError as e:
        r['error'] = __utils__['boto.get_error'](e)
    return r