mirror of
https://github.com/moparisthebest/mail
synced 2024-08-13 16:43:47 -04:00
cleanup comments
This commit is contained in:
parent
956e184574
commit
b25b5256d6
@ -86,9 +86,11 @@ app.crypto.RSA = function(forge) {
|
|||||||
this.sign = function(parts) {
|
this.sign = function(parts) {
|
||||||
var sha = forge.md.sha256.create();
|
var sha = forge.md.sha256.create();
|
||||||
parts.forEach(function(i) {
|
parts.forEach(function(i) {
|
||||||
|
// decode base64 part and append to sha msg
|
||||||
sha.update(utl.decode64(i));
|
sha.update(utl.decode64(i));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// encode signature to base64
|
||||||
return utl.encode64(privateKey.sign(sha));
|
return utl.encode64(privateKey.sign(sha));
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -99,11 +101,12 @@ app.crypto.RSA = function(forge) {
|
|||||||
* @return [bool] if the verification was successful
|
* @return [bool] if the verification was successful
|
||||||
*/
|
*/
|
||||||
this.verify = function(parts, sig) {
|
this.verify = function(parts, sig) {
|
||||||
// parse base64 signature to utf8
|
// decode base64 signature to utf8
|
||||||
var sigUtf8 = utl.decode64(sig);
|
var sigUtf8 = utl.decode64(sig);
|
||||||
|
|
||||||
var sha = forge.md.sha256.create();
|
var sha = forge.md.sha256.create();
|
||||||
parts.forEach(function(i) {
|
parts.forEach(function(i) {
|
||||||
|
// decode base64 part and append to sha msg
|
||||||
sha.update(utl.decode64(i));
|
sha.update(utl.decode64(i));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user