public static bool VerifySignedMessage(this IVerifier sig, IDigest digest, ArraySegment <byte> message) { if (message.Count <= sig.SignatureSize) { throw new InvalidOperationException("The message size is smaller than or equal to the size of a signature"); } var hash = digest.ComputeDigest( new ArraySegment <byte>(message.Array, message.Offset, message.Count - sig.SignatureSize)); return(sig.Verify( new ArraySegment <byte>(hash), new ArraySegment <byte>(message.Array, message.Offset + message.Count - sig.SignatureSize, sig.SignatureSize))); }
public object Execute(params string[] args) { if (args is null) { ThrowNotEnoughParams(0); } else if (args.Length < 2) { ThrowNotEnoughParams(args.Length); } var levelId = args[0]; var user = args[1]; var level = provider.GetLevel(levelId); return(verifier.Verify(level, user)); }
public VerificationResultDto Verify(int loanId) { VerificationResultDto result; // Move logic to _loanService // Step 1: Load loan data from Database (Moq data) Loan loan = MoqLoanData().FirstOrDefault(x => x.Id == loanId); if (loan != null) { // Step 2: Verify loan IVerifier verifier = GetVerifier(loan.Address.State); result = verifier.Verify(loan); } else { throw new System.Exception($"Requested Loan with id = {loanId} has been deleted or doesn't exist."); } return(result); }
public static bool Verify(this IVerifier sig, byte[] data, int offset, int count, ArraySegment <byte> signature) => sig.Verify(new ArraySegment <byte>(data, offset, count), signature);
public static bool Verify(this IVerifier sig, byte[] data, ArraySegment <byte> signature) => sig.Verify(new ArraySegment <byte>(data), signature);
public bool Verify() { return(_verifier.Verify(Storage)); }
public bool Verify(ArraySegment <byte> data, ArraySegment <byte> signature) => _verifier.Verify(data, signature);
public bool Verify(string input) { return(verifier.Verify(input)); }