EdSecretBcpgKey
Base class for an EdDSA secret key.
using Org.BouncyCastle.Math;
namespace Org.BouncyCastle.Bcpg
{
public sealed class EdSecretBcpgKey : BcpgObject, IBcpgKey
{
private readonly MPInteger m_x;
public BigInteger X => m_x.Value;
public string Format => "PGP";
public EdSecretBcpgKey(BcpgInputStream bcpgIn)
{
m_x = new MPInteger(bcpgIn);
}
public EdSecretBcpgKey(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);
}
}
}