wolfcose 0.1.0

Safe Rust API for wolfSSL wolfCOSE.
#![allow(missing_docs)]

use wolfcose::{CborDecoder, CborEncoder};

fn main() -> wolfcose::Result<()> {
    let mut out = [0u8; 32];
    let len = {
        let mut enc = CborEncoder::new(&mut out);
        enc.encode_array_start(2)?;
        enc.encode_u64(42)?;
        enc.encode_tstr("wolfCOSE")?;
        enc.len()
    };

    let mut dec = CborDecoder::new(&out[..len]);
    let count = dec.decode_array_start()?;
    let value = dec.decode_u64()?;
    let text = dec.decode_tstr_bytes()?;
    println!(
        "items={count} value={value} text={}",
        String::from_utf8_lossy(text)
    );
    Ok(())
}