- Initial commit
This commit is contained in:
28
Runtime/3rdParty/BouncyCastle/tls/crypto/impl/bc/BcTlsNonceGenerator.cs
vendored
Normal file
28
Runtime/3rdParty/BouncyCastle/tls/crypto/impl/bc/BcTlsNonceGenerator.cs
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user