anchor.diff:        {}
     end;
   
  +json_record_to_erlang([Name, <<"DNSKEY">>, Ttl, Data, _Context]) ->
  +  try base64_to_bin(erldns_config:keyget(<<"public_key">>, Data)) of
  +    PublicKey ->
  +    #dns_rr{
  +       name = Name,
  +       type = ?DNS_TYPE_DNSKEY,
  +       data = #dns_rrdata_dnskey{
  +                 flags = erldns_config:keyget(<<"flags">>, Data),
  +                 protocol = erldns_config:keyget(<<"protocol">>, Data),
  +                 alg = erldns_config:keyget(<<"alg">>, Data),
  +                 public_key = PublicKey,
  +                 key_tag = erldns_config:keyget(<<"keytag">>, Data)
  +                },
  +       ttl = Ttl}
  +  catch
  +    Exception:Reason ->
  +      lager:error("Error parsing DNSKEY: ~p: ~p (~p: ~p)", [Name, Data, Exception, Reason]),
  +      {}
  +  end;
  +
   json_record_to_erlang(_Data) ->
     %lager:debug("Cannot convert ~p", [Data]),
     {}.
  
positive.code: 
  -define(SERVER, ?MODULE).
  -define(PARSE_TIMEOUT, 30 * 1000).
  
  -record(state, {parsers}).
  
  
negative.code:             end
          end,
    << <<(Fun(A,B))>> || <<A, B>> <= Bin >>.
  
  base64_to_bin(Bin) when is_binary(Bin) ->
    base64:decode(Bin).
  
  -ifdef(TEST).
  
  base64_to_bin_test() ->
    ?assertEqual(base64_to_bin(<<"">>), <<"">>),
    ?assertEqual(base64_to_bin(<<"AwEAAb+lTDjZCfq7D5N9cNd1ug30wLrbCXB9mVJJQGlQQHpiHHlMaLGGsV2/j5+eojHp+WQUzNpOzrULF6msbEvUuV2gSEnpbueRV4twO8muGE+xeUuseSoHh/aTpA8Z9SPubb01mduqqaUEN5Juz2Q4hF0dSUSJYlJPKhp6NrOgoeyj">>), 
                 <<3,1,0,1,191,165,76,56,217,9,250,187,15,147,125,112,215,
    117,186,13,244,192,186,219,9,112,125,153,82,73,64,105,
    80,64,122,98,28,121,76,104,177,134,177,93,191,143,159,
    158,162,49,233,249,100,20,204,218,78,206,181,11,23,169,
    172,108,75,212,185,93,160,72,73,233,110,231,145,87,139,
    112,59,201,174,24,79,177,121,75,172,121,42,7,135,246,
    147,164,15,25,245,35,238,109,189,53,153,219,170,169,165,
    4,55,146,110,207,100,56,132,93,29,73,68,137,98,82,79,42,
    26,122,54,179,160,161,236,163>>).
  
  -endif.
  