简体   繁体   中英

erlang/elixir parse OCSPResponse (asn.1)

Is there any way to parse OCSP response in erlang/elixir? Probably I don't understand something, but it is ASN.1 type OCSPResponse fails

 :public_key.der_decode(:OCSPResponse,data)

Also I have tried download and compile:

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

but it fails with a list of errors:

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'}},

Is there something like OCSP lib in Ruby ?

elixir code

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM