13 lines
4.2 KiB
JavaScript
13 lines
4.2 KiB
JavaScript
const assert = require('assert');
|
|
const signer = require('./index');
|
|
|
|
const password = '012345678901234567890123456789AB';
|
|
const certificate = 'MIIKYQIBAzCCChoGCSqGSIb3DQEHAaCCCgsEggoHMIIKAzCCBW8GCSqGSIb3DQEHAaCCBWAEggVcMIIFWDCCBVQGCyqGSIb3DQEMCgECoIIE+zCCBPcwKQYKKoZIhvcNAQwBAzAbBBSRxddtGxr1B3L4l6VE3c9VJ2uNtAIDAMNQBIIEyLpZHqyi1DevUp4RkJCJ3Da47HrAfOUdZ3aha2mGBoJa66Hd1zcQhe9KPllE12JhVbQHIjY/lkbrt7KZptj8KHmed5vd8k7TuvVooKUw44Mxd8drq++6E13OJj+CNcW5ehXdSyN2VL9SUFshZyJf4rzAvSGWY/CNwbEXggqbsp6Lyv72R69/kfJm1lbaz+Ha4fwlF9YXFOr8ghDLOCVdCS0gPz1LqWaoLaYUuAY2C7dZ5c9zgvtyd9LJz2xNyny46RrzAboF/xwO3XvyY2LaszOPQ4/W8QjGpbBshbpOMd0YP1P53U5J3O8pAJgv8EvQYWy1HG+K2PHDaXv7J20DGauvHA/M+UpHEJ82fj1f7fnTic4Su1Labm86IyG9TU2AKeIrPoHk5HHIbdl6QYi1I5iV+wC0yyXQQ0zGrg/AMOTfO7IMi7mJiWmLVVkIdP/6UcvQ4dw+72njQ+oLr8lXBC7msEI9w0P2kHbxTi/lQZ9nAOrd0UDkE9Hk85vJlb0GgJ8lsePW39IvMqP3pLLLX+5iKQAq/k3i8bPFxLT8jFAteLoO9epGFmcgEyzeD8ZtgY8O0VCSLBCa+6m6w3iVw6Hmw/usSRbRm9aE2Py/fTnf1g1M5N4NK7t95F8IauzXI6J3UfmPlYVxvO6BYDvAOHjMFl8TIVH4vidOIG/1GBgiKKSH0jjglMVXveoKwh8ssa2HeFJ1QFcg2i41DUyeV/6R3YVkpBY0V8mO05sTn/PsrtBKSNFPGeggGkV3IwqesMQgRxtRl2awgRB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lF4GwW0WbGdPUVgYW5x4upptE1PYO+mlc2grCYy52NJ2DlXwAT1Agh2cVe+i1S2s9nGHHFoHSjCb5LMqPWE+oYnaICNmgiBAwIJp3Eqs47Vlriezi8cnlS6dZhBgqVC/tnoG56hYHRvD/az0k9ra7GDD9UChAQHwQAj8mjUbFDzwVKd6WwU+lGuLU873jI2cqe64Xz2DU/fXrci8bTH6N6+21l4rW1W+49JHoa+lIPe7m6WmHE37qFB9lbETtKpbF1OZjuykP9ySbC/rKfnwPwPILvxFSCYkWCiuZIcDgT0/yw0PHhvlwRlW49cJxDzLD0oA7FK39ywTNC99tWFIGtplc8BhWyVqo4wPjAhMAkGBSsOAwIaBQAEFH8M34p8W3P5DQjPhHJ3h1c21OEVBBRrY106fqyzCCmc0jpKuoimwORPGQIDAYag';
|
|
const content = '{}';
|
|
const expectedSignature = 'PeEBjuVV4iI/bF5ljIBeTEhS/0htSsDsTQtExVYvX4dn9UJtZJZOYiVQZRLQHRv0sYmAufF9FqK/w+8wavUS0JdaehLewOAX/ppgxlyg3O1U/yYm7hwpGppoSh15M5hnFtBu7kEEJAb1akPACL64GEfAemfkyJVq5lab5W/1+oCQRdFePwLkrP1k8MQiMLYYPGY4+Sb/UEr4TmgahMwE9ZUVS+8NAxyi5sTwrejzvCl7/Z5o6mAtl5zFSxCgocKldVn/+A8z0/v87p4Zf5dgLCYcV+CLE+gEw22lFuBG3tnmfq3O4YBpg72RDvu5lYT0DLIHtUdibskB2GRNg3gDig==';
|
|
|
|
it('signatures should match', (done) => {
|
|
signer.signContent(password, certificate, content).then(result => {
|
|
assert.equal(result, expectedSignature);
|
|
}).then(done, done);
|
|
});
|