class Sodium::SecureBuffer
 
  - Sodium::SecureBuffer
 - Crypto::Secret
 - Reference
 - Object
 
Overview
Allocate guarded memory using sodium_malloc
#initialize returns readonly or readwrite for thread safety 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.
Included Modules
- Crypto::Secret::Stateful
 
Extended Modules
- Crypto::Secret::ClassMethods
 
Defined in:
sodium/secure_buffer.crConstructors
- .new(buffer_bytesize : Int32)
 - 
        .new(bytes : Bytes, erase = false)
        
          
Copies bytes to a readonly SecureBuffer.
DEPRECATED Use .copy_from or .move_from
 
Instance Method Summary
- #buffer_bytesize : Int32
 - 
        #to_slice : Bytes
        
          
Returns key May permanently set key to readonly depending on class usage.
DEPRECATED Use the Slice provided within a
readonlyorreadwriteblock 
Constructor Detail
Copies bytes to a readonly SecureBuffer. Optionally erases bytes after copying if erase is set Returns a readonly SecureBuffer.
DEPRECATED Use .copy_from or .move_from
Instance Method Detail
Returns key May permanently set key to readonly depending on class usage.
WARNING Not thread safe unless this object is readonly or readwrite
DEPRECATED  Use the Slice provided within a readonly or readwrite block