declare module 'koa-connect-flash' {
const def: any;
export default def;
}
npm init
npm install -S JSCPP
public static IEnumerable<string> GetPublicKeysList(IReadOnlyList<Certificate> serverCertificates)
{
for (var i = 0; i < serverCertificates.Count; i++)
{
string publicKey = null;
try
{
var certificate = new X509Certificate2(serverCertificates[0].GetCertificateBlob().ToArray());
var ms = new MemoryStream(certificate.RawData);
using (var reader = new BerReader(ms))
{
var asnCert = reader.ReadToEnd(true);
var pkNode = asnCert.ChildNodes[0].ChildNodes[0].ChildNodes[6]; // тут лежит сам ключ
byte[] pkBuffer = new byte[pkNode.Length + (pkNode.DataOffsetToStream - pkNode.StartPosition)];
ms.Seek(pkNode.StartPosition, SeekOrigin.Begin);
ms.Read(pkBuffer, 0, pkNode.Length + (int)(pkNode.DataOffsetToStream - pkNode.StartPosition)); // чтобы не потерять последние 4 байта
publicKey = Convert.ToBase64String(pkBuffer);
}
}
catch (Exception ex)
{
throw new SecurityException($"Cant get public key {ex.Message}");
}
yield return publicKey;
}
}
FileStream fileStream = new FileStream(fileName, FileMode.OpenOrCreate);
fileStream.Write(data, 0, data.Length);
fileStream.Close();
SELECT reltuples FROM pg_class WHERE oid = 'schema_name.table_name'::regclass;
<StatusBar DockPanel.Dock="Bottom" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<StatusBar.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition>
</RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80" />
<ColumnDefinition Width="100*" />
<ColumnDefinition Width="100*" />
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</StatusBar.ItemsPanel>
<StatusBarItem DockPanel.Dock="Left" Grid.Column="0">
<ProgressBar Name="ExecutionProgress" Height="20" Margin="3" MinWidth="200" MaxWidth="400" ></ProgressBar>
</StatusBarItem>
<StatusBarItem HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" Grid.Column="1">
<ComboBox Name="ExecutionEvents" Width="{Binding Parent.ActualWidth, Mode=OneWay, RelativeSource={RelativeSource Self}}">
<ComboBoxItem>jfjfjxdfvbdfhfghfghfghfghfghjfg[pjkhlp'fghfg]ophkfg]pkh]pfg]hkfg]pkh]pfghokfg]pkh]-fg</ComboBoxItem>
</ComboBox>
</StatusBarItem>
<StatusBarItem HorizontalAlignment="Right" Grid.Column="2">
<StackPanel Orientation="Horizontal" Height="Auto" DockPanel.Dock="Right">
<Button Name="SaveExecutionLog" Content="Save Log" Margin="2" Padding="4"></Button>
<Button Name="ClearExecutionLog" Content="Clear Log" Margin="2" Padding="4"></Button>
</StackPanel>
</StatusBarItem>
</StatusBar>
SELECT 'id' FROM Cars
client.NoDelay = true;