Ssl Erlang ASN.1 otp编译';PKCS7';模块p7b文件至pem
我想用证书链将p7b文件编码到pem 我可以使用Ssl Erlang ASN.1 otp编译';PKCS7';模块p7b文件至pem,ssl,openssl,erlang,otp,asn.1,Ssl,Openssl,Erlang,Otp,Asn.1,我想用证书链将p7b文件编码到pem 我可以使用opensslpkcs7-print_certs-in certificate.p7b-out certificate.cer在控制台中执行此操作 我想用ErlangSSL库来实现这一点——看起来otp应该已经在没有asn.1的情况下实现了 但是 但是PKCS7模块未定义-asn.1未编译 2> 'PKCS7':decode('SignedData', Der1). ** exception error: und
opensslpkcs7-print_certs-in certificate.p7b-out certificate.cer在控制台中执行此操作
我想用ErlangSSL库来实现这一点——看起来otp应该已经在没有asn.1的情况下实现了
但是
但是PKCS7模块未定义-asn.1未编译
2> 'PKCS7':decode('SignedData', Der1).
** exception error: undefined function 'PKCS7':decode/2
如果我手动下载并尝试编译,我将得到错误
3> asn1ct:compile('PKCS7.asn')
PKCS7:13: 'Attribute' is not exported from InformationFramework
...
{error,[{structured_error,{'PKCS7',13},
asn1ct_check,
{undefined_import,'Attribute','InformationFramework'}},
{structured_error,{'PKCS7',13},
问题1:有没有办法在不手动下载asn.1模块的情况下编译“PKCS7”?我确信我错过了一些重要的东西,这个文件应该自动作为otp库工作
问题2:也许有一些最简单的方法将p7b编码到pem链
是否有使用otp/lib/asn.1的文档?无需编译ANS.1模块PKCS7。Erlang(Elixir)函数public\u key:der\u decode/2
使用'ContentInfo'
原子作为第一个参数ASN1Type
(长生不老药代码)
但问题是为什么“PKCS7”:解码不起作用仍然打开你能对这段代码添加一些解释吗?您的答案似乎是肯定的,它不需要额外编译ASN.1模块
3> asn1ct:compile('PKCS7.asn')
PKCS7:13: 'Attribute' is not exported from InformationFramework
...
{error,[{structured_error,{'PKCS7',13},
asn1ct_check,
{undefined_import,'Attribute','InformationFramework'}},
{structured_error,{'PKCS7',13},
{:ContentInfo, _id, content_info} = :public_key.der_decode(:ContentInfo, p7b_binary)
{:certSet, certificates_set} = elem(content_info, 4)