ElGamalSecretBcpgKey
Base class for an ElGamal secret key.
using Org.BouncyCastle.Math;
namespace Org.BouncyCastle.Bcpg
{
public class ElGamalSecretBcpgKey : BcpgObject, IBcpgKey
{
private readonly MPInteger m_x;
public BigInteger X => m_x.Value;
public string Format => "PGP";
public ElGamalSecretBcpgKey(BcpgInputStream bcpgIn)
{
m_x = new MPInteger(bcpgIn);
}
public ElGamalSecretBcpgKey(BigInteger x)
{
m_x = new MPInteger(x);
}
public override byte[] GetEncoded()
{
return BcpgOutputStream.GetEncodedOrNull(m_x);
}
public override void Encode(BcpgOutputStream bcpgOut)
{
m_x.Encode(bcpgOut);
}
}
}