diff options
Diffstat (limited to 'lib/VNLib.Plugins.Extensions.Loading')
-rw-r--r-- | lib/VNLib.Plugins.Extensions.Loading/src/Secrets/VaultSecrets.cs | 8 | ||||
-rw-r--r-- | lib/VNLib.Plugins.Extensions.Loading/src/VNLib.Plugins.Extensions.Loading.csproj | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/VNLib.Plugins.Extensions.Loading/src/Secrets/VaultSecrets.cs b/lib/VNLib.Plugins.Extensions.Loading/src/Secrets/VaultSecrets.cs index a5ba550..9be74ee 100644 --- a/lib/VNLib.Plugins.Extensions.Loading/src/Secrets/VaultSecrets.cs +++ b/lib/VNLib.Plugins.Extensions.Loading/src/Secrets/VaultSecrets.cs @@ -214,7 +214,7 @@ namespace VNLib.Plugins.Extensions.Loading /// <exception cref="ArgumentNullException"></exception> public static PrivateKey GetPrivateKey(this ISecretResult secret) { - _ = secret ?? throw new ArgumentNullException(nameof(secret)); + ArgumentNullException.ThrowIfNull(secret); return new PrivateKey(secret); } @@ -228,15 +228,15 @@ namespace VNLib.Plugins.Extensions.Loading /// <exception cref="ArgumentNullException"></exception> public static ReadOnlyJsonWebKey GetJsonWebKey(this ISecretResult secret) { - _ = secret ?? throw new ArgumentNullException(nameof(secret)); - + ArgumentNullException.ThrowIfNull(secret); + //Alloc buffer, utf8 so 1 byte per char using IMemoryHandle<byte> buffer = MemoryUtil.SafeAlloc<byte>(secret.Result.Length); //Get utf8 bytes int count = Encoding.UTF8.GetBytes(secret.Result, buffer.Span); - return new ReadOnlyJsonWebKey(buffer.Span[..count]); + return ReadOnlyJsonWebKey.FromUtf8Bytes(buffer.Span[..count]); } #nullable disable diff --git a/lib/VNLib.Plugins.Extensions.Loading/src/VNLib.Plugins.Extensions.Loading.csproj b/lib/VNLib.Plugins.Extensions.Loading/src/VNLib.Plugins.Extensions.Loading.csproj index 1dfaa30..be21770 100644 --- a/lib/VNLib.Plugins.Extensions.Loading/src/VNLib.Plugins.Extensions.Loading.csproj +++ b/lib/VNLib.Plugins.Extensions.Loading/src/VNLib.Plugins.Extensions.Loading.csproj @@ -49,10 +49,10 @@ </ItemGroup> <ItemGroup> - <ProjectReference Include="..\..\..\..\..\core\lib\Utils\src\VNLib.Utils.csproj" /> - <ProjectReference Include="..\..\..\..\..\core\lib\Plugins\src\VNLib.Plugins.csproj" /> - <ProjectReference Include="..\..\..\..\..\core\lib\Plugins.Essentials\src\VNLib.Plugins.Essentials.csproj" /> - <ProjectReference Include="..\..\..\..\..\core\lib\Plugins.PluginBase\src\VNLib.Plugins.PluginBase.csproj" /> + <ProjectReference Include="..\..\..\..\core\lib\Utils\src\VNLib.Utils.csproj" /> + <ProjectReference Include="..\..\..\..\core\lib\Plugins\src\VNLib.Plugins.csproj" /> + <ProjectReference Include="..\..\..\..\core\lib\Plugins.Essentials\src\VNLib.Plugins.Essentials.csproj" /> + <ProjectReference Include="..\..\..\..\core\lib\Plugins.PluginBase\src\VNLib.Plugins.PluginBase.csproj" /> </ItemGroup> </Project> |