Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        public virtual Task <SignResult> SignAsync(SignatureAlgorithm algorithm, byte[] digest, CancellationToken cancellationToken = default)
        {
            SignResult result = Sign(algorithm, digest, cancellationToken);

            return(Task.FromResult(result));
        }
Ejemplo n.º 3
0
 public virtual VerifyResult Verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, CancellationToken cancellationToken = default)
 {
     throw CreateOperationNotSupported(nameof(Verify));
 }
Ejemplo n.º 4
0
 public virtual VerifyResult Verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, CancellationToken cancellationToken = default)
 {
     throw new NotSupportedException();
 }
Ejemplo n.º 5
0
 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));
 }
Ejemplo n.º 10
0
 Task <VerifyResult> ICryptographyProvider.VerifyAsync(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, CancellationToken cancellationToken)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 11
0
 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));
 }
Ejemplo n.º 13
0
 public VerifyResult Verify(SignatureAlgorithm algorithm, byte[] digest, byte[] signature, CancellationToken cancellationToken)
 {
     // TODO
     throw new NotImplementedException();
 }
Ejemplo n.º 14
0
 public SignResult Sign(SignatureAlgorithm algorithm, byte[] digest, CancellationToken cancellationToken)
 {
     // TODO
     throw new NotImplementedException();
 }