Trusted-eSign / trusted-crypto

A native library implementing of cryptography, ciphers, PKI and the formats that are used in PKI applications.
Apache License 2.0
20 stars 12 forks source link

Не работает функция import() подписи из памяти #9

Open nshdigt opened 7 years ago

nshdigt commented 7 years ago

Примерно такой тест: console.log("Export"); var cms; var buf; cms = new trusted.cms.SignedData(); buf = cms.export(trusted.DataFormat.PEM); assert.equal(buf.length !==0, true, "Wrong sign export");

console.log("Import"); var cms; cms = new trusted.cms.SignedData(); cms.import(buf, trusted.DataFormat.PEM); // console.log(cms.certificates().length); // assert.equal(cms.signers().length, 1, "Wrong signers length"); // assert.equal(cms.certificates().length, 1, "Wrong certificates length"); // assert.equal(cms.isDetached(), false, "Detached");

algv commented 7 years ago
Error: read Error read cms
../src/wrapper/cms/signed_data.cpp:127
read PEM_read_bio_CMS
../src/wrapper/cms/signed_data.cpp:93

140031159080832:error:0906D06C:PEM routines:PEM_read_bio:no start line:../deps/openssl/openssl/crypto/pem/pem_lib.c:701:Expecting: CMS