def add_apt_key(ent, target=None): """ Add key to the system as defined in ent (if any). Supports raw keys or keyid's The latter will as a first step fetched to get the raw key """ if 'keyid' in ent and 'key' not in ent: keyserver = DEFAULT_KEYSERVER if 'keyserver' in ent: keyserver = ent['keyserver'] ent['key'] = gpg.getkeybyid(ent['keyid'], keyserver) if 'key' in ent: add_apt_key_raw(ent['key'], target)
def add_apt_key(ent, target=None): """ Add key to the system as defined in ent (if any). Supports raw keys or keyid's The latter will as a first step fetched to get the raw key """ if 'keyid' in ent and 'key' not in ent: keyserver = DEFAULT_KEYSERVER if 'keyserver' in ent: keyserver = ent['keyserver'] ent['key'] = gpg.getkeybyid(ent['keyid'], keyserver) if 'key' in ent: add_apt_key_raw(ent['key'], target)
def add_apt_key(ent, target=None, hardened=False, file_name=None): """ Add key to the system as defined in ent (if any). Supports raw keys or keyid's The latter will as a first step fetched to get the raw key """ if "keyid" in ent and "key" not in ent: keyserver = DEFAULT_KEYSERVER if "keyserver" in ent: keyserver = ent["keyserver"] ent["key"] = gpg.getkeybyid(ent["keyid"], keyserver) if "key" in ent: return add_apt_key_raw(ent["key"], file_name or ent["filename"], hardened=hardened)