Skip to content

Commit

Permalink
ISO 18013-5 samples
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Nov 21, 2024
1 parent 72e3464 commit f6bd457
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/eudi/mdoc.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ defmodule CA.MDoc do
require CBOR
@moduledoc "CA/MDOC MSO mDOC library."

# https://mobiledl-e5018.web.app/ISO_18013-5_E_draft.pdf

def decode(nil) do nil end
def decode(bin) do CBOR.decode(bin) end

Expand All @@ -17,6 +19,7 @@ defmodule CA.MDoc do
".b64" -> [bin: byte_size(:erlang.term_to_binary(:base64.decode(bin))), name: x]
".b64u" -> [bin: byte_size(:erlang.term_to_binary(:base64.decode(replace(replace(bin,"_","/"),"-","+")))), name: x]
".hex" -> [bin: byte_size(:erlang.term_to_binary(:oid.unhex(bin))), name: x]
".hexbin" -> [bin: byte_size(:erlang.term_to_binary(:oid.unhex(bin))), name: x]
end
end

Expand Down

0 comments on commit f6bd457

Please sign in to comment.