erlang / elixir解析OCSPResponse(asn.1)

时间:2018-08-01 17:45:11

标签: erlang elixir ocsp

有什么方法可以解析erlang / elixir中的OCSP响应吗? 可能我听不懂,但这是ASN.1类型OCSPResponse失败

 :public_key.der_decode(:OCSPResponse,data)

我也尝试下载并编译:

asn1ct:compile("/Users/edenlab/workspace/ocsp_client/ocsp.asn1", [ber, verbose]).

但失败并显示错误列表:

OCSP-2009:8: 'ATTRIBUTE' is not exported from PKIX-CommonTypes-2009
OCSP-2009:8: 'EXTENSION' is not exported from PKIX-CommonTypes-2009
...
OCSP-2009:180: illegal OBJECT IDENTIFIER
OCSP-2009:181: illegal OBJECT IDENTIFIER
{error,[{structured_error,{'OCSP-2009',8},
                          asn1ct_check,
                          {undefined_import,'ATTRIBUTE','PKIX-CommonTypes-2009'}},

是否有类似OCSP lib in Ruby的东西?

1 个答案:

答案 0 :(得分:0)

elixir代码

with {:CertificateList, tbs_certs, _, _} <- 
:public_key.der_decode(:CertificateList, data),
{:TBSCertList, _, _, _, _, {:utcTime, ts}, certs, _} <- tbs_certs do
...
end