public virtual Task <VerifyResult> VerifyAsync(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, CancellationToken cancellationToken = default) { VerifyResult result = Verify(algorithm, digest, signature, cancellationToken); return(Task.FromResult(result)); }
public virtual Task <SignResult> SignAsync(SignatureAlgorithm algorithm, byte[] digest, CancellationToken cancellationToken = default) { SignResult result = Sign(algorithm, digest, cancellationToken); return(Task.FromResult(result)); }
public virtual VerifyResult Verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, CancellationToken cancellationToken = default) { throw CreateOperationNotSupported(nameof(Verify)); }
public virtual VerifyResult Verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, CancellationToken cancellationToken = default) { throw new NotSupportedException(); }
public virtual SignResult Sign(SignatureAlgorithm algorithm, byte[] digest, CancellationToken cancellationToken = default) { throw CreateOperationNotSupported(nameof(Sign)); }
async Task <VerifyResult> ICryptographyProvider.VerifyAsync(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, CancellationToken cancellationToken) { return(await VerifyAsync(algorithm, digest, signature, cancellationToken).ConfigureAwait(false)); }
VerifyResult ICryptographyProvider.Verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, CancellationToken cancellationToken) { return(Verify(algorithm, digest, signature, cancellationToken)); }
async Task <SignResult> ICryptographyProvider.SignAsync(SignatureAlgorithm algorithm, byte[] digest, CancellationToken cancellationToken) { return(await SignAsync(algorithm, digest, cancellationToken).ConfigureAwait(false)); }
SignResult ICryptographyProvider.Sign(SignatureAlgorithm algorithm, byte[] digest, CancellationToken cancellationToken) { return(Sign(algorithm, digest, cancellationToken)); }
Task <VerifyResult> ICryptographyProvider.VerifyAsync(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, CancellationToken cancellationToken) { throw new NotImplementedException(); }
SignResult ICryptographyProvider.Sign(SignatureAlgorithm algorithm, byte[] digest, CancellationToken cancellationToken) { throw new NotImplementedException(); }
private static byte[] CreateDigest(SignatureAlgorithm algorithm, Stream data) { using HashAlgorithm hashAlgo = algorithm.GetHashAlgorithm(); return(hashAlgo.ComputeHash(data)); }
public VerifyResult Verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, CancellationToken cancellationToken) { // TODO throw new NotImplementedException(); }
public SignResult Sign(SignatureAlgorithm algorithm, byte[] digest, CancellationToken cancellationToken) { // TODO throw new NotImplementedException(); }