- Initial commit
This commit is contained in:
31
Runtime/3rdParty/BouncyCastle/tls/crypto/impl/bc/BcTlsEd448Signer.cs
vendored
Normal file
31
Runtime/3rdParty/BouncyCastle/tls/crypto/impl/bc/BcTlsEd448Signer.cs
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
#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.Crypto.Signers;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Tls.Crypto.Impl.BC
|
||||
{
|
||||
public class BcTlsEd448Signer
|
||||
: BcTlsSigner
|
||||
{
|
||||
public BcTlsEd448Signer(BcTlsCrypto crypto, Ed448PrivateKeyParameters privateKey)
|
||||
: base(crypto, privateKey)
|
||||
{
|
||||
}
|
||||
|
||||
public override TlsStreamSigner GetStreamSigner(SignatureAndHashAlgorithm algorithm)
|
||||
{
|
||||
if (algorithm == null || SignatureScheme.From(algorithm) != SignatureScheme.ed448)
|
||||
throw new InvalidOperationException("Invalid algorithm: " + algorithm);
|
||||
|
||||
Ed448Signer signer = new Ed448Signer(TlsUtilities.EmptyBytes);
|
||||
signer.Init(true, m_privateKey);
|
||||
|
||||
return new BcTlsStreamSigner(signer);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
Reference in New Issue
Block a user