System.Formats.Cbor 10.0.2

Prefix Reserved
dotnet add package System.Formats.Cbor --version 10.0.2
                    
NuGet\Install-Package System.Formats.Cbor -Version 10.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="System.Formats.Cbor" Version="10.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="System.Formats.Cbor" Version="10.0.2" />
                    
Directory.Packages.props
<PackageReference Include="System.Formats.Cbor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add System.Formats.Cbor --version 10.0.2
                    
#r "nuget: System.Formats.Cbor, 10.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package System.Formats.Cbor@10.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=System.Formats.Cbor&version=10.0.2
                    
Install as a Cake Addin
#tool nuget:?package=System.Formats.Cbor&version=10.0.2
                    
Install as a Cake Tool

About

Provides support for reading and writing values in Concise Binary Object Representation (CBOR) format, as originally defined in IETF RFC 7049.

Key Features

  • Reader and writer types for the CBOR format.
  • Built-in support for different CBOR conformance modes.

How to Use

Write and read primitives:

using System.Formats.Cbor;

var cborWriter = new CborWriter(CborConformanceMode.Lax);
cborWriter.WriteTextString("Hello World");

var cborReader = new CborReader(cborWriter.Encode(), CborConformanceMode.Lax);
Console.WriteLine(cborReader.ReadTextString());
// Hello World

Write and read an array:

var cborWriter = new CborWriter(CborConformanceMode.Lax);
cborWriter.WriteStartArray(5);
for (var index = 0; index < 5; index++)
{
    cborWriter.WriteInt32(index);
}
cborWriter.WriteEndArray();

var cborReader = new CborReader(cborWriter.Encode(), CborConformanceMode.Lax);
var arrayLength = cborReader.ReadStartArray();
for (var index = 0; index < arrayLength; index++)
{
    Console.Write(cborReader.ReadInt32());
}
// 01234
cborReader.ReadEndArray();

Inspect writer and reader state:

var cborWriter = new CborWriter(CborConformanceMode.Lax);
cborWriter.WriteTextString("SomeArray");
Console.WriteLine(cborWriter.BytesWritten);
// 10
Console.WriteLine(cborWriter.IsWriteCompleted);
// True

var cborReader = new CborReader(cborWriter.Encode(), CborConformanceMode.Lax);
Console.WriteLine(cborReader.BytesRemaining);
// 10
Console.WriteLine(cborReader.ReadTextString());
// SomeArray
Console.WriteLine(cborReader.BytesRemaining);
// 0

Main Types

The main types provided by this library are:

  • System.Formats.Cbor.CborReader
  • System.Formats.Cbor.CborWriter
  • System.Formats.Cbor.CborReaderState
  • System.Formats.Cbor.CborConformanceMode
  • System.Formats.Cbor.CborContentException
  • System.Formats.Cbor.CborTag

Additional Documentation

Feedback & Contributing

System.Formats.Cbor is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (29)

Showing the top 5 NuGet packages that depend on System.Formats.Cbor:

Package Downloads
Fido2

FIDO2 .NET library (WebAuthn)

System.Security.Cryptography.Cose

Provides support for CBOR Object Signing and Encryption (COSE).

Yubico.YubiKey

Yubico.YubiKey is the official .NET library for integrating with the YubiKey hardware authenticator. This library supports both macOS and Windows operating systems.

AWSSDK.Extensions.CborProtocol

This package contains shared serialization and deserialization logic for services that use Cbor protocol in the AWS SDK for .NET.

Rewrite.Remote

Package Description

GitHub repositories (6)

Showing the top 6 popular GitHub repositories that depend on System.Formats.Cbor:

Repository Stars
passwordless-lib/fido2-net-lib
Passkeys, FIDO2 and WebAuhtn .NET library.
dodobrands/WebAuthn.Net
WebAuthn (Passkeys) library for .NET.
eiriktsarpalis/PolyType
Practical generic programming for .NET
bitwarden/mobile
Retired Bitwarden mobile app for iOS and Android (MAUI/Xamarin).
glatzert/ACME-Server-ADCS
ACME (RFC 8555) compatible implementation, connecting to Active Directory Certificate Services (ADCS)
Yubico/Yubico.NET.SDK
A YubiKey SDK for .NET developers
Version Downloads Last Updated
10.0.2 749 1/13/2026
10.0.1 5,558 12/9/2025
10.0.0 25,269 11/11/2025
10.0.0-rc.2.25502.107 274 10/14/2025
10.0.0-rc.1.25451.107 315 9/9/2025
10.0.0-preview.7.25380.108 212 8/12/2025
10.0.0-preview.6.25358.103 189 7/15/2025
10.0.0-preview.5.25277.114 239 6/6/2025
10.0.0-preview.4.25258.110 391 5/12/2025
10.0.0-preview.3.25171.5 697 4/10/2025
10.0.0-preview.2.25163.2 252 3/18/2025
10.0.0-preview.1.25080.5 256 2/25/2025
9.0.12 275 1/13/2026
9.0.11 2,054 11/11/2025
9.0.10 14,753 10/14/2025
9.0.9 7,545 9/9/2025
9.0.8 14,734 8/4/2025
9.0.7 37,219 7/8/2025
9.0.6 6,326 6/10/2025
9.0.5 140,206 5/13/2025
9.0.4 20,067 4/8/2025
9.0.3 15,318 3/11/2025
9.0.2 40,565 2/11/2025
9.0.1 11,892 1/14/2025
9.0.0 509,221 11/12/2024
9.0.0-rc.2.24473.5 1,124 10/8/2024
9.0.0-rc.1.24431.7 321 9/10/2024
9.0.0-preview.7.24405.7 254 8/13/2024
9.0.0-preview.6.24327.7 208 7/9/2024
9.0.0-preview.5.24306.7 6,539 6/11/2024
9.0.0-preview.4.24266.19 176 5/21/2024
9.0.0-preview.3.24172.9 196 4/11/2024
9.0.0-preview.2.24128.5 459 3/12/2024
9.0.0-preview.1.24080.9 254 2/13/2024
8.0.0 633,936 11/14/2023
8.0.0-rc.2.23479.6 375,301 10/10/2023
8.0.0-rc.1.23419.4 355 9/12/2023
8.0.0-preview.7.23375.6 303 8/8/2023
8.0.0-preview.6.23329.7 300 7/11/2023
8.0.0-preview.5.23280.8 285 6/13/2023
8.0.0-preview.4.23259.5 376 5/16/2023
8.0.0-preview.3.23174.8 830 4/11/2023
8.0.0-preview.2.23128.3 356 3/14/2023
8.0.0-preview.1.23110.8 310 2/21/2023
7.0.0 402,761 11/7/2022
7.0.0-rc.2.22472.3 322 10/11/2022
7.0.0-rc.1.22426.10 399 9/14/2022
7.0.0-preview.7.22375.6 711 8/9/2022
7.0.0-preview.6.22324.4 1,483 7/12/2022
7.0.0-preview.5.22301.12 645 6/14/2022
7.0.0-preview.4.22229.4 409 5/10/2022
7.0.0-preview.3.22175.4 2,138 4/13/2022
7.0.0-preview.2.22152.2 22,671 3/14/2022
7.0.0-preview.1.22076.8 409 2/17/2022
6.0.0 2,156,535 11/8/2021
6.0.0-rc.2.21480.5 369 10/12/2021
6.0.0-rc.1.21451.13 411 9/14/2021
6.0.0-preview.7.21377.19 403 8/10/2021
6.0.0-preview.6.21352.12 439 7/14/2021
6.0.0-preview.5.21301.5 408 6/15/2021
6.0.0-preview.4.21253.7 384 5/24/2021
6.0.0-preview.3.21201.4 413 4/8/2021
6.0.0-preview.2.21154.6 448 3/11/2021
6.0.0-preview.1.21102.12 384 2/12/2021
5.0.0 410,107 11/9/2020 5.0.0 is deprecated because it is no longer maintained.
5.0.0-rc.2.20475.5 469 10/13/2020
5.0.0-rc.1.20451.14 574 9/14/2020
5.0.0-preview.8.20407.11 482 8/25/2020
5.0.0-preview.7.20364.11 659 7/21/2020