Files
2026-07-03 05:02:26 +03:00

29 lines
754 B
C#

#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
#pragma warning disable
using System;
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng;
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Tls.Crypto.Impl.BC
{
internal sealed class BcTlsNonceGenerator
: TlsNonceGenerator
{
private readonly IRandomGenerator m_randomGenerator;
internal BcTlsNonceGenerator(IRandomGenerator randomGenerator)
{
this.m_randomGenerator = randomGenerator;
}
public byte[] GenerateNonce(int size)
{
byte[] nonce = new byte[size];
m_randomGenerator.NextBytes(nonce);
return nonce;
}
}
}
#pragma warning restore
#endif