English 中文(简体)
node.js 数字签名不可行
原标题:node.js digital signature does not work

我试图利用密码模块生成一个数字签字,用于代号(0.6.15)。 下面的代码没有(窗户和中型机器)和长度为0。 同样,无论我所说的是关键的东西,签字人也永远不会放弃一个例外。 开放式安装在第1.0.1版。 我做了什么错误?

var crypto = require( crypto );
var signer = crypto.createSign("RSA-SHA1")
signer.update("sign me!")

//dummy key
var private_key = "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAL4vpoH3H3byehjj" +
    "7RAGxefGRATiq4mXtzc9Q91W7uT0DTaFEbjzVch9aGsNjmLs4QHsoZbuoUmi0st4" +
    "x5z9SQpTAKC/dW8muzacT3E7dJJYh03MAO6RiH4LG34VRTq1SQN6qDt2rCK85eG4" +
    "5NHI4jceptZNu6Zot1zyO5/PYuFpAgMBAAECgYAhspeyF3M/xB7WIixy1oBiXMLY" +
    "isESFAumgfhwU2LotkVRD6rgNl1QtMe3kCNWa9pCWQcYkxeI0IzA+JmFu2shVvoR" +
    "oL7eV4VCe1Af33z24E46+cY5grxNhHt/LyCnZKcitvCcrzXExUc5n6KngX0mMKgk" +
    "W7skZDwsnKzhyUV8wQJBAN2bQMeASQVOqdfqBdFgC/NPnKY2cuDi6h659QN1l+kg" +
    "X3ywdZ7KKftJo1G9l45SN9YpkyEd9zEO6PMFaufJvZUCQQDbtAWxk0i8BT3UTNWC" +
    "T/9bUQROPcGZagwwnRFByX7gpmfkf1ImIvbWVXSpX68/IjbjSkTw1nj/Yj1NwFZ0" +
    "nxeFAkEAzPhRpXVBlPgaXkvlz7AfvY+wW4hXHyyi0YK8XdPBi25XA5SPZiylQfjt" +
    "Z6iN6qSfYqYXoPT/c0/QJR+orvVJNQJBANhRPNXljVTK2GDCseoXd/ZiI5ohxg+W" +
    "UaA/1fDvQsRQM7TQA4NXI7BO/YmSk4rW1jIeOxjiIspY4MFAIh+7UL0CQFL6zTg6" +
    "wfeMlEZzvgqwCGoLuvTnqtvyg45z7pfcrg2cHdgCXIy9kErcjwGiu6BOevEA1qTW" +
    "Rk+bv0tknWvcz/s="

var res = signer.sign(private_key, output_format= base64 )
console.log(res);
最佳回答

As Ben Noordhuis tells me here the key used above is not in the correct format. it is best to load the pem format from disk.

问题回答

暂无回答




相关问题
SignedXml.CheckSignature Performance Issue

I have an issue with checking the signature of an XML file using .NET 3.5. It all works fine, but randomly the performance is poor. Sometimes it s instant and yet at other times it can take maybe 10 ...

How do I securely sign data with a timestamp?

I would like to sign records in a database with a secure timestamp to prove they have not been altered by anyone after that date. What methods or protocols should I consider? RFC 3161? Most of the ...

Sign with RSA-1024 an SHA-256 digest: what is the size?

I was wondering: 1) if I compute the digest of some datas with SHA-512 => resulting in a hash of 64 bytes 2) and then I sign this hash with RSA-1024 => so a block of 128 bytes, which is bigger than ...

Render PDF in SSRS 2008 with digital signature block

We are using SSRS 2008 to render pdf reports for our users. They would like the capability to digitally sign these reports. Is there anyway to add a digital signature block to a pdf file using SSRS ...

How to sign a custom JCE security provider

Sun s PKCS11 JCE security provider is lacking some functionality we need. So I wrote an enhanced version of it using the original sources. Unfortunately the JCE infrastructure rejects the new ...

热门标签