fingerprint works on secret key too
This commit is contained in:
parent
0b2942e382
commit
191aeaa4d9
@ -798,16 +798,19 @@ class OpenPGP_PublicKeyPacket extends OpenPGP_Packet {
|
|||||||
case 3:
|
case 3:
|
||||||
return $this->fingerprint = md5($this->key['n'] . $this->key['e']);
|
return $this->fingerprint = md5($this->key['n'] . $this->key['e']);
|
||||||
case 4:
|
case 4:
|
||||||
$material = array(
|
$head = array(
|
||||||
chr(0x99), pack('n', $this->length),
|
chr(0x99), NULL,
|
||||||
chr($this->version), pack('N', $this->timestamp),
|
chr($this->version), pack('N', $this->timestamp),
|
||||||
chr($this->algorithm),
|
chr($this->algorithm),
|
||||||
);
|
);
|
||||||
|
$material = array();
|
||||||
foreach ($this->key as $data) {
|
foreach ($this->key as $data) {
|
||||||
$material[] = pack('n', OpenPGP::bitlength($data));
|
$material[] = pack('n', OpenPGP::bitlength($data));
|
||||||
$material[] = $data;
|
$material[] = $data;
|
||||||
}
|
}
|
||||||
return $this->fingerprint = sha1(implode('', $material));
|
$material = implode('', $material);
|
||||||
|
$head[1] = pack('n', 6 + strlen($material));
|
||||||
|
return $this->fingerprint = sha1(implode('',$head).$material);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user