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
45
46
47
48
49
50
51
52
namespace Devolutions.Cryptography
{
using System;
/// <summary>
/// Utilitary class to contain both the private and public key.
/// </summary>
public class KeyPair
{
/// <summary>
/// Gets or sets the private key.
/// </summary>
public byte[] PrivateKey { get; set; }
/// <summary>
/// Gets the private key as base 64 string.
/// </summary>
public string PrivateKeyString
{
get
{
if (this.PrivateKey == null)
{
return null;
}
return Convert.ToBase64String(this.PrivateKey);
}
}
/// <summary>
/// Gets or sets the public key.
/// </summary>
public byte[] PublicKey { get; set; }
/// <summary>
/// Gets the public key key as base 64 string.
/// </summary>
public string PublicKeyString
{
get
{
if (this.PublicKey == null)
{
return null;
}
return Convert.ToBase64String(this.PublicKey);
}
}
}
}