Credential Exchange Format (CXF)
This crate contains type definitions for the FIDO Alliance’s credential exchange format specification. It's targeting the Review Draft, March 13, 2025 revision.
The Credential Exchange Format defines standardized data structures and format of credentials that can be exchanged between two applications.
For more information about the credential exchange protocol, please read the Bitwarden blog post or the Fido Alliance announcement.
Disclaimer
This library does not automatically clear sensitive values from memory. It is heavily encouraged to use it alongside a zeroizing global allocator like
zeroizing-alloc. We may be open to pull requests that adds nativezeroizesupport depending on the developer ergonomics.
This library is still in early development and as the specification evolves so will this library.
Usage
use Account;
Compatibility with Apple's Credential migration
The JSON representation of
ASImportableAccount
maps directly to this crate's Account struct.
Note that Foundation
JSONEncoder and
JSONDecoder do not use the
secondsSince1970 date format by default, and you will need to set that explicitly:
static let cxfEncoder: JSONEncoder = {
let encoder = JSONEncoder()
encoder.dateEncodingStrategy = .secondsSince1970
return encoder
}()
static let cxfDecoder: JSONDecoder = {
let decoder = JSONDecoder()
decoder.dateDecodingStrategy = .secondsSince1970
return decoder
}()