blob: 4d9a63ce11fbdd3a827074206c39b5bd359730c7 (
plain) (
blame)
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
|
using System.Collections.Generic;
using Org.BouncyCastle.Asn1;
using Org.BouncyCastle.Crypto;
namespace Org.BouncyCastle.Pkcs
{
public class AsymmetricKeyEntry
: Pkcs12Entry
{
private readonly AsymmetricKeyParameter key;
public AsymmetricKeyEntry(AsymmetricKeyParameter key)
: base(new Dictionary<DerObjectIdentifier, Asn1Encodable>())
{
this.key = key;
}
public AsymmetricKeyEntry(AsymmetricKeyParameter key,
IDictionary<DerObjectIdentifier, Asn1Encodable> attributes)
: base(attributes)
{
this.key = key;
}
public AsymmetricKeyParameter Key
{
get { return this.key; }
}
public override bool Equals(object obj)
{
AsymmetricKeyEntry other = obj as AsymmetricKeyEntry;
if (other == null)
return false;
return key.Equals(other.key);
}
public override int GetHashCode()
{
return ~key.GetHashCode();
}
}
}
|