From c68c7762ce9023af8b65ce58adee167fc9788ee1 Mon Sep 17 00:00:00 2001 From: vnugent Date: Mon, 28 Aug 2023 21:51:11 -0400 Subject: big data updates, secret file support, --- .../src/Secrets/SecretResult.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/VNLib.Plugins.Extensions.Loading/src/Secrets/SecretResult.cs') diff --git a/lib/VNLib.Plugins.Extensions.Loading/src/Secrets/SecretResult.cs b/lib/VNLib.Plugins.Extensions.Loading/src/Secrets/SecretResult.cs index f2cbd28..c1e6b3d 100644 --- a/lib/VNLib.Plugins.Extensions.Loading/src/Secrets/SecretResult.cs +++ b/lib/VNLib.Plugins.Extensions.Loading/src/Secrets/SecretResult.cs @@ -42,7 +42,14 @@ namespace VNLib.Plugins.Extensions.Loading public ReadOnlySpan Result => _secretChars; - internal SecretResult(ReadOnlySpan value) => _secretChars = value.ToArray(); + internal SecretResult(ReadOnlySpan value) : this(value.ToArray()) + { } + + private SecretResult(char[] secretChars) + { + _secretChars = secretChars; + } + /// protected override void Free() @@ -56,5 +63,7 @@ namespace VNLib.Plugins.Extensions.Loading MemoryUtil.UnsafeZeroMemory(result); return res; } + + internal static SecretResult ToSecret(char[] result) => new(result); } } -- cgit