mirror of
https://github.com/bitwarden/server
synced 2025-12-16 08:13:33 +00:00
Async GetEmbeddedCertificate
This commit is contained in:
@@ -169,13 +169,13 @@ namespace Bit.Core.Utilities
|
||||
return new X509Certificate2(file, password);
|
||||
}
|
||||
|
||||
public static X509Certificate2 GetEmbeddedCertificate(string file, string password)
|
||||
public async static Task<X509Certificate2> GetEmbeddedCertificateAsync(string file, string password)
|
||||
{
|
||||
var assembly = typeof(CoreHelpers).GetTypeInfo().Assembly;
|
||||
using(var s = assembly.GetManifestResourceStream($"Bit.Core.{file}"))
|
||||
using(var ms = new MemoryStream())
|
||||
{
|
||||
s.CopyTo(ms);
|
||||
await s.CopyToAsync(ms);
|
||||
return new X509Certificate2(ms.ToArray(), password);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user