node-apn
Version:
An interface to the Apple Push Notification service for Node.js
18 lines (12 loc) • 335 B
JavaScript
;
var forge = require("node-forge");
function APNKey(key) {
if(!key || !key.n || !key.e) {
throw new Error("key is not a valid public key");
}
this._key = key;
}
APNKey.prototype.fingerprint = function() {
return forge.pki.getPublicKeyFingerprint(this._key, {encoding: "hex"});
};
module.exports = APNKey;