Crypto::Secret::Stateful
Inherits Crypto::Secret
Development guide:
- Create your initialize method and optionally allocate memory
- Create a finalize method to deallocate memory if necessary
- Fill in the missing abstract methods
- Optionally override any included methods (especially wipe_impl if the secret is not held in the provided slice)
- Provide and test a dup method or raise on dup if not possible
When state changes are required (such as using #noaccess) and the buffer is accessed from multiple threads wrap each #readonly/#readwrite block in a lock.
Instance methods
dup
Sourcenoaccess
Makes a region inaccessible. It cannot be read or written, but the data are preserved. WARNING: Not thread safe
readonly
Temporarily make buffer readonly within the block returning to the prior state on exit. WARNING: Not thread safe unless this object is readonly or readwrite
readonly
Marks a region allocated using sodium_malloc() or sodium_allocarray() as read-only. WARNING: Not thread safe
readwrite
Temporarily make buffer readwrite within the block returning to the prior state on exit. WARNING: Not thread safe unless this object is readwrite
reset
Source