mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-03-30 15:08:32 +00:00
add signature check to integration test
This commit is contained in:
parent
63db9246c6
commit
9ee587ad4f
@ -4,7 +4,7 @@
|
||||
require.config({
|
||||
baseUrl: './',
|
||||
paths: {
|
||||
openpgp: '../../resources/openpgp.min'
|
||||
openpgp: '../../resources/openpgp'
|
||||
},
|
||||
shim: {
|
||||
openpgp: {
|
||||
|
@ -132,7 +132,7 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Encrypt', function() {
|
||||
describe('Encrypt and Sign', function() {
|
||||
it('should work', function(done) {
|
||||
pgp.encrypt(message, [pubkey], function(err, ct) {
|
||||
expect(err).to.not.exist;
|
||||
@ -143,11 +143,12 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Decrypt', function() {
|
||||
describe('Decrypt and verify', function() {
|
||||
it('should work', function(done) {
|
||||
pgp.decrypt(ciphertext, pubkey, function(err, pt) {
|
||||
expect(err).to.not.exist;
|
||||
expect(pt).to.equal(message);
|
||||
expect(pt.text).to.equal(message);
|
||||
expect(pt.validSignatures[0]).to.be.true;
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
@ -160,7 +160,7 @@ define(function(require) {
|
||||
}
|
||||
if (keymat !== null) {
|
||||
var decrypted = msg.decryptAndVerifySignature(keymat, sesskey, senderKey);
|
||||
callback(null, decrypted.text);
|
||||
callback(null, decrypted);
|
||||
|
||||
} else {
|
||||
callback({
|
||||
|
Loading…
x
Reference in New Issue
Block a user