Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ VerifyData() [3/4]

virtual bool System.Security.Cryptography.RSA.VerifyData ( ReadOnlySpan< byte > data,
ReadOnlySpan< byte > signature,
HashAlgorithmName hashAlgorithm,
RSASignaturePadding padding )
inlinevirtualinherited

Definition at line 305 of file RSA.cs.

306 {
307 if (string.IsNullOrEmpty(hashAlgorithm.Name))
308 {
310 }
311 if (padding == null)
312 {
313 throw new ArgumentNullException("padding");
314 }
315 int num = 256;
316 while (true)
317 {
318 int bytesWritten = 0;
320 try
321 {
322 if (TryHashData(data, array, hashAlgorithm, out bytesWritten))
323 {
324 return VerifyHash(new ReadOnlySpan<byte>(array, 0, bytesWritten), signature, hashAlgorithm, padding);
325 }
326 }
327 finally
328 {
330 }
331 num = checked(num * 2);
332 }
333 }
static void Return(byte[] array, int clearSize=-1)
Definition CryptoPool.cs:12
static byte[] Rent(int minimumLength)
Definition CryptoPool.cs:7
static Exception HashAlgorithmNameNullOrEmpty()
Definition RSA.cs:672
virtual bool TryHashData(ReadOnlySpan< byte > data, Span< byte > destination, HashAlgorithmName hashAlgorithm, out int bytesWritten)
Definition RSA.cs:116
virtual bool VerifyHash(byte[] hash, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
Definition RSA.cs:75

References System.array, System.Security.Cryptography.RSA.HashAlgorithmNameNullOrEmpty(), System.Security.Cryptography.HashAlgorithmName.Name, System.Security.Cryptography.CryptoPool.Rent(), System.Security.Cryptography.CryptoPool.Return(), System.Security.Cryptography.RSA.TryHashData(), and System.Security.Cryptography.RSA.VerifyHash().