javascript - How can I sign a document using PKCS7, CAdES, S/MIME (e-cpf / e-cnpj) to create a P7S file using javascript on the browser?
问题描述
I was able to read a p12 certificate file and, using the password, I was able to extract:
key
andcert
using forge methods:forge.pkcs12.pkcs12FromAsn1
andgetBags({friendlyName: this.selectedFriendlyName}).friendlyName
privatePem
usingforge.pki.privateKeyToPem
I found some solutions to sign a message or document using PKCS7, CAdES and S/MIME, but none of them produced a P7S file and the result is different than a proper P7S content (byte array), and that is what I understood is the correct file format to be used in E-CPF/E-CNPJ signed documents.
I would like to archive this using javascript on the browser, but any help or direction will be appreciated, thank you in advance :)
解决方案
看起来你是巴西人......检查这个 PHP 答案是否有帮助。
推荐阅读
- django - django sitemap.xml 文档与原始站点地图文档相矛盾
- java - 我的应用程序如何在 android 上确认系统过渡主题(深色 -> 浅色/浅色 -> 深色)?
- flutter - Flutter - 如何在数据表中创建标题过滤器
- reactjs - React 应用在 GitHub 页面中显示空白页面
- python - TypeError:float() 参数必须是字符串或数字,而不是“SingleBlockManager”
- reactjs - MUI 的 Autocomplete AS MULTIPLE input + react-hook-form + 控制默认值不起作用(TypeError: Can't read property 'filter' of undefined)
- mysql - 格式化字符串,每 3 位数字之间有一个小数分隔符
- python - 如何将字符串“2020-07-29 10:27:08+02:00”转换为这种格式“2020-07-29T08:27:16.494Z”?
- javascript - 使用 vee-validate 点击 nuxt-link 按钮时需要弹出 Nuxtjs 多步表单验证
- javascript - 如何显示输入值?