init commit
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Org.BouncyCastle.Crypto;
|
||||
using Org.BouncyCastle.Utilities;
|
||||
|
||||
namespace Org.BouncyCastle.Pkcs;
|
||||
|
||||
public class AsymmetricKeyEntry : Pkcs12Entry
|
||||
{
|
||||
private readonly AsymmetricKeyParameter key;
|
||||
|
||||
public AsymmetricKeyParameter Key => key;
|
||||
|
||||
public AsymmetricKeyEntry(AsymmetricKeyParameter key)
|
||||
: base(Platform.CreateHashtable())
|
||||
{
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
[Obsolete]
|
||||
public AsymmetricKeyEntry(AsymmetricKeyParameter key, Hashtable attributes)
|
||||
: base(attributes)
|
||||
{
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public AsymmetricKeyEntry(AsymmetricKeyParameter key, IDictionary attributes)
|
||||
: base(attributes)
|
||||
{
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (!(obj is AsymmetricKeyEntry asymmetricKeyEntry))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return key.Equals(asymmetricKeyEntry.key);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return ~key.GetHashCode();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user