Use this for holding sensitive key material in memory. Call destroy()
when the key is no longer needed to minimize the window during which
key bytes are accessible in the process address space.
Note: JavaScript's garbage collector may copy the underlying ArrayBuffer
during compaction, so this is a best-effort mitigation, not a guarantee.
A buffer that zeros its contents on
destroy().Use this for holding sensitive key material in memory. Call
destroy()when the key is no longer needed to minimize the window during which key bytes are accessible in the process address space.Note: JavaScript's garbage collector may copy the underlying ArrayBuffer during compaction, so this is a best-effort mitigation, not a guarantee.
Example