mirror of
https://github.com/bitwarden/server.git
synced 2025-07-04 01:22:50 -05:00
Move into and read ciphers from org subvaults
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
using System;
|
||||
using Dapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
@ -40,6 +43,28 @@ namespace Bit.Core.Utilities
|
||||
return new Guid(guidArray);
|
||||
}
|
||||
|
||||
public static DataTable ToGuidIdArrayTVP(this IEnumerable<Guid> ids)
|
||||
{
|
||||
return ids.ToArrayTVP("GuidId");
|
||||
}
|
||||
|
||||
public static DataTable ToArrayTVP<T>(this IEnumerable<T> values, string columnName)
|
||||
{
|
||||
var table = new DataTable();
|
||||
table.Columns.Add(columnName, typeof(T));
|
||||
table.SetTypeName($"[dbo].[{columnName}Array]");
|
||||
|
||||
if(values != null)
|
||||
{
|
||||
foreach(var value in values)
|
||||
{
|
||||
table.Rows.Add(value);
|
||||
}
|
||||
}
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
public static X509Certificate2 GetCertificate(string thumbprint)
|
||||
{
|
||||
// Clean possible garbage characters from thumbprint copy/paste
|
||||
|
Reference in New Issue
Block a user