Skip to main content

Crate liboscore

Crate liboscore 

Source
Expand description

Wrapper around the liboscore C library, which implements the OSCORE RFC, and thus symmetric encryption for the CoAP protocol.

To ensure proper setup and teardown of data structures that include references, several functions in this library take callbacks in which the accessed data is used; for example, an encrypted message is passed to protect_request() along with a callback, and the plaintext is then passed back to the caller in that callback closure inside protect_request(). While nothing in this library is a potentially-blocking operation (and thus worht async’ifying), there might be asynchronous code in callbacks: Therefore, asynchronous versions of the functions are provided that take asynchronous callbacks. They are functionally identical. Future versions of this crate might consider other idioms rather than callbacks (e.g. destructors) to avoid going through callbacks altogether.

Modules§

raw
Re-exports from bindgen-generated types.

Structs§

AeadAlg
An AEAD algorithm (usable for OSCORE message protection)
AlgorithmNotSupported
Error type for algorithm constructors
HkdfAlg
An HKDF algorithm (usable for OSCORE context derivation)
OscoreOption
Extracted data of (and indices into) the data inside the OSCORE option
PrimitiveContext
A simplistic owned primitive context
PrimitiveImmutables
The immutable parts of a security context.
ProtectedMessage
A view on the plaintext of a to-be-encrypted or freshly-decrypted message.

Enums§

DeriveError
FinishError
PrepareError
ProtectError
UnprotectRequestError
UnprotectResponseError

Functions§

async_protect_request
Protects an OSCORE request.
async_protect_response
Protects an OSCORE response.
async_unprotect_request
Unprotects an OSCORE request.
async_unprotect_response
Unprotects an OSCORE response.
protect_request
Synchronous version of async_protect_request, see there.
protect_response
Synchronous version of async_protect_response, see there.
unprotect_request
Synchronous version of async_unprotect_request, see there.
unprotect_response
Synchronous version of async_unprotect_response, see there.