Function SecretBuffer.withBytes

Use the secret bytes for one operation.

void withBytes(
  scope @safe void delegate(scope const(ubyte)[]) callback
) scope @trusted const;

Keep the operation that needs the secret inside callback.

Parameters

NameDescription
callback Code that uses the secret bytes.

Examples

secret.withBytes((scope const(ubyte)[] bytes) @safe
{
    // Call the API that needs bytes here.
});