/// <summary> /// Callback signs the digest with X509SignatureGenerator. /// </summary> public object GetResult() { var memStream = Stream as MemoryStream; var digest = memStream.ToArray(); var signature = _generator.SignData(digest, _hashAlgorithm); return(new MemoryBlockResult(signature)); }
public Task <byte[]> SignAsync(MemoryStream source) { Logger.LogInformation($"start {nameof(SignAsync)}"); var pos = source.Position; source.Position = 0; var signatureCert = VerificationKeyGenerator.SignData(source.ToArray(), HashAlgorithmName.SHA256); source.Position = pos; return(Task.FromResult(signatureCert)); }
/// <summary> /// Callback signs the digest with X509SignatureGenerator. /// </summary> public object GetResult() { var memStream = Stream as MemoryStream; if (memStream == null) { throw new ArgumentNullException(nameof(Stream)); } var digest = memStream.ToArray(); var signature = _generator.SignData(digest, _hashAlgorithm); return(new MemoryBlockResult(signature)); }
public override byte[] SignData(byte[] data, HashAlgorithmName hashAlgorithm) => _realRsaGenerator.SignData(data, hashAlgorithm);