SecureByteString
An immutable sequence of bytes containing sensitive data with memory clearing on disposal.
Instances of this class hold sensitive data in an internal buffer. When the data is no longer needed, callers should invoke destroy or close, or use Kotlin's use extension. Upon disposal, the internal memory is overwritten with zeros using ByteArray.secureZero.
As a secondary safety net, an automatic cleaner (KeyDisposer) is registered at creation to zero the memory when the object becomes unreachable, guarding against memory leaks if close is inadvertently omitted.
Parameters
the initial data. A defensive copy is stored.
Inheritors
Functions
Throws IllegalStateException if this byte string has been destroyed.
Returns true if this byte string is not empty.
Returns a defensive copy of the underlying bytes as a ByteArray.
Converts this SecureByteString to a SecretKey.