gecko-dev/dom/webauthn/cbor-cpp
J.C. Jones 91d5522630 Bug 1380529 - Add a CBOR library for WebAuthn (1/3) r=ttaubert
Web Authentication's WD-05 specification moves to using (CBOR) Concise Binary
Object Representation to transmit the binary data... most of it. This lands a
subset of the Apache 2-licensed "CBOR C++" serialization library [1] into
webauthn's path.

It does not add any code to use this library; see patch 2/3.

[1] https://github.com/naphaso/cbor-cpp/

MozReview-Commit-ID: Ktj9TgdqElk

--HG--
extra : rebase_source : e36c956ef62be3ea1a3b6cbc8e3d6df2626c15b1
2017-07-13 18:12:57 -07:00
..
src
README.md

README.md

cbor-cpp

Gitter

CBOR C++ serialization library

Just a simple SAX-like Concise Binary Object Representation (CBOR).

http://tools.ietf.org/html/rfc7049

Examples

    cbor::output_dynamic output;

    { //encoding
        cbor::encoder encoder(output);
        encoder.write_array(5);
        {
            encoder.write_int(123);
            encoder.write_string("bar");
            encoder.write_int(321);
            encoder.write_int(321);
            encoder.write_string("foo");
        }
    }

    { // decoding
        cbor::input input(output.data(), output.size());
        cbor::listener_debug listener;
        cbor::decoder decoder(input, listener);
        decoder.run();
    }