久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

NodeJS:以 DER 格式驗(yàn)證證書

NodeJS: Validate certificate in DER format(NodeJS:以 DER 格式驗(yàn)證證書)
本文介紹了NodeJS:以 DER 格式驗(yàn)證證書的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我正在使用 crypto 模塊來驗(yàn)證證書,但我的證書和公鑰都是 DER 格式.crypto 模塊似乎不接受這種格式.

I'm using crypto module to validate a certificate, but both, my certificate and my public key are in DER format. It seems that crypto module does not accept this format.

有沒有辦法(或模塊)使用 NodeJS 將 DER 轉(zhuǎn)換為 PEM 格式?我找不到任何東西,也無法使用命令行通過 shell 調(diào)用 openssl.

Is there a way (or module) to convert DER to PEM format using NodeJS? I couldn't find any and cannot use command line to call openssl via shell.

更新:這與 HTTPS 證書無關(guān).這是關(guān)于一般的 X.509 證書.如果您將問題標(biāo)記為否定,請(qǐng)發(fā)表評(píng)論以證明其合理性.幫不上忙也別傻了.

UPDATE: It's not about HTTPS certificates. It's about general X.509 certificates. And if you mark the question as negative, please leave a comment to justify it. Don't be a stupid if you are not able to help.

推薦答案

Dominykas 的回答很好,但就我而言,我有一個(gè)使用 ECCnode-forge 不支持它.所以我找到了一個(gè)名為 node-openssl-wrapper 的模塊,效果很好,因?yàn)樗鼘?openssl 命令封裝在一個(gè)簡(jiǎn)單的函數(shù)調(diào)用中,如下所示:

Dominykas' answer was good, but in my case, I have a certificate that uses ECC and node-forge does not support it. So I've found a module called node-openssl-wrapper, which worked perfectly well because it encapsulates the openssl commands in a simple function call, like this:

co(function*() {
  var ossl = require('openssl-wrapper');
  var derCert = new Buffer('...'); // binary DER certificate
  var pemCert = yield ossl.qExec('x509', derCert, { inform: 'der', outform: 'pem' });
});

這篇關(guān)于NodeJS:以 DER 格式驗(yàn)證證書的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Using discord.js to detect image and respond(使用 discord.js 檢測(cè)圖像并響應(yīng))
Check if user ID exists in Discord server(檢查 Discord 服務(wù)器中是否存在用戶 ID)
Guild Member Add does not work (discordjs)(公會(huì)成員添加不起作用(discordjs))
Creating my first bot using REPLIT but always error Discord.JS(使用 REPLIT 創(chuàng)建我的第一個(gè)機(jī)器人,但總是錯(cuò)誤 Discord.JS)
How do I code event/command handlers for my Discord.js bot?(如何為我的 Discord.js 機(jī)器人編寫事件/命令處理程序?)
How to find a User ID from a Username in Discord.js?(如何從 Discord.js 中的用戶名中查找用戶 ID?)
主站蜘蛛池模板: 国产成人99久久亚洲综合精品 | 免费v片| 欧美电影在线观看网站 | 久久综合一区二区三区 | 午夜免费在线 | www.嫩草 | 久久国产精品视频免费看 | 超碰电影 | 欧美 日韩 国产 一区 | 欧美成人一区二免费视频软件 | 久久伊人影院 | 国产偷录叫床高潮录音 | 中文字幕视频网 | 久久国产精品首页 | 久久午夜视频 | 精品网| 久久久噜噜噜久久中文字幕色伊伊 | 国产成人一区二区三区 | 免费看黄视频网站 | 精品综合在线 | 一区二区成人 | 精品国产黄a∨片高清在线 www.一级片 国产欧美日韩综合精品一区二区 | 国产精品射| 天天拍天天操 | 国产黄a一级 | 秋霞a级毛片在线看 | 蜜臀久久99精品久久久久野外 | 亚洲高清在线观看 | www.4567| 一区二区三区福利视频 | 成年免费大片黄在线观看一级 | 日韩精品成人av | 日韩成人免费中文字幕 | 在线观看中文字幕 | 国产精品99久久久久久久久 | 男女免费观看在线爽爽爽视频 | 欧美成人精品激情在线观看 | 97久久精品午夜一区二区 | 久久久www | 97国产一区二区精品久久呦 | 亚洲在线一区 |