Files
SuperVPN/output/Libraries/BouncyCastle.Crypto/Org/BouncyCastle/Bcpg/ModDetectionCodePacket.cs
2025-10-09 09:57:24 +09:00

38 lines
717 B
C#

using System;
namespace Org.BouncyCastle.Bcpg;
public class ModDetectionCodePacket : ContainedPacket
{
private readonly byte[] digest;
internal ModDetectionCodePacket(BcpgInputStream bcpgIn)
{
if (bcpgIn == null)
{
throw new ArgumentNullException("bcpgIn");
}
digest = new byte[20];
bcpgIn.ReadFully(digest);
}
public ModDetectionCodePacket(byte[] digest)
{
if (digest == null)
{
throw new ArgumentNullException("digest");
}
this.digest = (byte[])digest.Clone();
}
public byte[] GetDigest()
{
return (byte[])digest.Clone();
}
public override void Encode(BcpgOutputStream bcpgOut)
{
bcpgOut.WritePacket(PacketTag.ModificationDetectionCode, digest, oldFormat: false);
}
}