blob: ffb47cda1dbea9b99ba3a71cd1ba717cb00b466b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
// **********************************************************************
//
// Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
namespace IceSSL
{
using System;
using System.Diagnostics;
using System.Security.Cryptography.X509Certificates;
/// <summary>
/// This class provides information about a connection to applications
/// that require information about a peer, for example, to implement
/// a CertificateVerifier.
/// </summary>
public sealed class NativeConnectionInfo : ConnectionInfo
{
/// <summary>
/// The certificate chain. This may be null if the peer did not
/// supply a certificate. The peer's certificate (if any) is the
/// first one in the chain.
/// </summary>
public X509Certificate2[] nativeCerts;
}
public sealed class Util
{
public static X509Certificate2 createCertificate(string certPEM)
{
char[] chars = certPEM.ToCharArray();
byte[] bytes = new byte[chars.Length];
for(int i = 0; i < chars.Length; ++i)
{
bytes[i] = (byte)chars[i];
}
return new X509Certificate2(bytes);
}
}
}
|