34 public void SignHeader(ReadOnlySpan<byte> signedHeader, Span<byte> destination)
36 ObjectDisposedException.ThrowIf(_disposed,
this);
37 if (signedHeader.Length != 0xE00 || destination.Length != 128)
39 throw new ArgumentException(
"DSi signing requires a 0xE00-byte header prefix and 128-byte destination.");
42 using RSA rsa = RSA.Create();
43 rsa.ImportParameters(_parameters);
44#pragma warning disable CA5350, CA5387
45 if (!rsa.TrySignData(signedHeader, destination, HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1, out
int written) ||
46 written != destination.Length)
47#pragma warning restore CA5350, CA5387
49 throw new CryptographicException(
"The RSA provider did not produce the required 128-byte DSi signature.");