def make_revocation_key_subpacket(fingerprint, pub_algorithm_type, sensitive=False, critical=False, hashed=True): data = bytearray([0x80 + (0x40 if sensitive else 0x00), pub_algorithm_type]) data.extend(utils.hex_to_bytes(fingerprint, 20)) return make_signature_subpacket(12, data, critical, hashed)
def content(self): hash_length = utils.hash_lengths.get(self.hash_algorithm, None) if hash_length is None: hash_length = self.hash_length return bytearray( [int(self.public_key_algorithm), int(self.hash_algorithm)] + utils.hex_to_bytes(self.hash, hash_length) )
def make_revocation_key_subpacket(fingerprint, pub_algorithm_type, sensitive=False, critical=False, hashed=True): data = bytearray( [0x80 + (0x40 if sensitive else 0x00), pub_algorithm_type]) data.extend(utils.hex_to_bytes(fingerprint, 20)) return make_signature_subpacket(12, data, critical, hashed)
def content(self): hash_length = utils.hash_lengths.get(self.hash_algorithm, None) if hash_length is None: hash_length = self.hash_length return bytearray([ int(self.public_key_algorithm), int(self.hash_algorithm), ] + utils.hex_to_bytes(self.hash, hash_length))
def content(self): warnings.warn("The additional recipients request signature subpacket " "type is deprecated.") data = bytearray([ 0x80 if self.strong_request else 0x00, self.public_key_algorithm, ]) data.extend(utils.hex_to_bytes(self.fingerprint, 20)) return data
def __bytes__(self): result = bytearray( [self.hash_algorithm] + b'GNU' + [self.mode - 1000] ) if self.mode == 1002 and self.serial_number is not None: result.append(self.serial_number_length) result.extend(utils.hex_to_bytes(self.serial_number, self.serial_number_length)) return bytes(result)
def make_issuer_key_subpacket(key_id, critical=False, hashed=True): data = utils.hex_to_bytes(key_id, 8) return make_signature_subpacket(16, data, critical, hashed)
def content(self): data = bytearray(utils.hex_to_bytes(self.key_id, 8)) return data
def content(self): warnings.warn("The additional recipients request signature subpacket " "type is deprecated.") data = bytearray([0x80 if self.strong_request else 0x00, self.public_key_algorithm]) data.extend(utils.hex_to_bytes(self.fingerprint, 20)) return data