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)
- Algorithm
NotSupported - Error type for algorithm constructors
- HkdfAlg
- An HKDF algorithm (usable for OSCORE context derivation)
- Oscore
Option - Extracted data of (and indices into) the data inside the OSCORE option
- Primitive
Context - A simplistic owned primitive context
- Primitive
Immutables - The immutable parts of a security context.
- Protected
Message - A view on the plaintext of a to-be-encrypted or freshly-decrypted message.
Enums§
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.