- Initial commit
This commit is contained in:
29
Runtime/3rdParty/BouncyCastle/crypto/generators/X448KeyPairGenerator.cs
vendored
Normal file
29
Runtime/3rdParty/BouncyCastle/crypto/generators/X448KeyPairGenerator.cs
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Security;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators
|
||||
{
|
||||
public class X448KeyPairGenerator
|
||||
: IAsymmetricCipherKeyPairGenerator
|
||||
{
|
||||
private SecureRandom random;
|
||||
|
||||
public virtual void Init(KeyGenerationParameters parameters)
|
||||
{
|
||||
this.random = parameters.Random;
|
||||
}
|
||||
|
||||
public virtual AsymmetricCipherKeyPair GenerateKeyPair()
|
||||
{
|
||||
X448PrivateKeyParameters privateKey = new X448PrivateKeyParameters(random);
|
||||
X448PublicKeyParameters publicKey = privateKey.GeneratePublicKey();
|
||||
return new AsymmetricCipherKeyPair(publicKey, privateKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
Reference in New Issue
Block a user