- Initial commit
This commit is contained in:
33
Runtime/3rdParty/BouncyCastle/crypto/operators/DefaultVerifierResult.cs
vendored
Normal file
33
Runtime/3rdParty/BouncyCastle/crypto/operators/DefaultVerifierResult.cs
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators
|
||||
{
|
||||
public class DefaultVerifierResult
|
||||
: IVerifier
|
||||
{
|
||||
private readonly ISigner mSigner;
|
||||
|
||||
public DefaultVerifierResult(ISigner signer)
|
||||
{
|
||||
this.mSigner = signer;
|
||||
}
|
||||
|
||||
public bool IsVerified(byte[] signature)
|
||||
{
|
||||
return mSigner.VerifySignature(signature);
|
||||
}
|
||||
|
||||
public bool IsVerified(byte[] sig, int sigOff, int sigLen)
|
||||
{
|
||||
byte[] signature = Arrays.CopyOfRange(sig, sigOff, sigOff + sigLen);
|
||||
|
||||
return IsVerified(signature);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
Reference in New Issue
Block a user