mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2026-03-13 03:50:00 +00:00
Don't hash when comparing key fingerprints
This commit is contained in:
@@ -229,10 +229,18 @@ PublicKey.prototype.getFingerprintBytes = function () {
|
||||
* Calculates the fingerprint of the key
|
||||
* @returns {String} A string containing the fingerprint in lowercase hex
|
||||
*/
|
||||
PublicKey.prototype.getFingerprint = function () {
|
||||
PublicKey.prototype.getFingerprint = function() {
|
||||
return util.Uint8Array_to_hex(this.getFingerprintBytes());
|
||||
};
|
||||
|
||||
/**
|
||||
* Calculates whether two keys have the same fingerprint without actually calculating the fingerprint
|
||||
* @returns {Boolean} Whether the two keys have the same version and public key data
|
||||
*/
|
||||
PublicKey.prototype.hasSameFingerprintAs = function(other) {
|
||||
return this.version === other.version && util.equalsUint8Array(this.writePublicKey(), other.writePublicKey());
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns algorithm information
|
||||
* @returns {Object} An object of the form {algorithm: String, bits:int, curve:String}
|
||||
|
||||
Reference in New Issue
Block a user