示例#1
0
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)
        )
示例#3
0
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
示例#6
0
 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)
示例#7
0
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
示例#9
0
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)
示例#10
0
 def content(self):
     data = bytearray(utils.hex_to_bytes(self.key_id, 8))
     return data
示例#11
0
 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