System.Security.Cryptography.RSACryptoServiceProvider.RSACryptoServiceProvider.GetHash C# (CSharp) Method

GetHash() private method

private GetHash ( object halg ) : HashAlgorithm
halg object
return HashAlgorithm
		private HashAlgorithm GetHash (object halg) 
		{
			if (halg == null)
				throw new ArgumentNullException ("halg");

			HashAlgorithm hash = null;
			if (halg is String)
				hash = HashAlgorithm.Create ((String)halg);
			else if (halg is HashAlgorithm)
				hash = (HashAlgorithm) halg;
			else if (halg is Type)
				hash = (HashAlgorithm) Activator.CreateInstance ((Type)halg);
			else
				throw new ArgumentException ("halg");

			return hash;
		}