AsymmetricKeyEntry
using Org.BouncyCastle.Asn1;
using Org.BouncyCastle.Crypto;
using System;
using System.Collections.Generic;
namespace Org.BouncyCastle.Pkcs
{
public class AsymmetricKeyEntry : Pkcs12Entry
{
private readonly AsymmetricKeyParameter m_key;
public AsymmetricKeyParameter Key => m_key;
public AsymmetricKeyEntry(AsymmetricKeyParameter key)
: base(new Dictionary<DerObjectIdentifier, Asn1Encodable>())
{
if (key == null)
throw new ArgumentNullException("key");
m_key = key;
}
public AsymmetricKeyEntry(AsymmetricKeyParameter key, IDictionary<DerObjectIdentifier, Asn1Encodable> attributes)
: base(attributes)
{
if (key == null)
throw new ArgumentNullException("key");
m_key = key;
}
public override bool Equals(object obj)
{
AsymmetricKeyEntry asymmetricKeyEntry = obj as AsymmetricKeyEntry;
if (asymmetricKeyEntry != null)
return m_key.Equals(asymmetricKeyEntry.m_key);
return false;
}
public override int GetHashCode()
{
return ~m_key.GetHashCode();
}
}
}