forked from libgit2/libgit2sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCertificateX509.cs
More file actions
32 lines (28 loc) · 835 Bytes
/
Copy pathCertificateX509.cs
File metadata and controls
32 lines (28 loc) · 835 Bytes
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
using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
using LibGit2Sharp.Core;
namespace LibGit2Sharp
{
/// <summary>
/// Conains a X509 certificate
/// </summary>
public class CertificateX509 : Certificate
{
/// <summary>
/// For mocking purposes
/// </summary>
protected CertificateX509()
{ }
/// <summary>
/// The certificate.
/// </summary>
public virtual X509Certificate Certificate { get; private set; }
internal CertificateX509(GitCertificateX509 cert)
{
int len = checked((int) cert.len.ToUInt32());
byte[] data = new byte[len];
Marshal.Copy(cert.data, data, 0, len);
Certificate = new X509Certificate(data);
}
}
}