mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 00:22:50 -05: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