Exam 70-536 : .NET Framework Application Development Foundation Part – 10

Question: You work as a developer at Company.com. You are creating an assembly named Company1. Company1 contains a public method. The global cache contains a second assembly named Company2. You must ensure that the public method is only called from Company2. Which permission class should you use?

  1. GacIdentityPermission
  2. PublisherIdentityPermission
  3. DataProtectionPermission
  4. StrongNameIdentityPermission

Correct Answer: 4


Question: You are developing a method to hash data with the Secure Hash Algorithm. The data is passed to your method as a byte array named message. You need to compute the hash of the incoming parameter by using SHA1. You also need to place the result into a byte array named hash. Which code segment should you use?

  1. SHA1 sha = new SHA1CryptoServiceProvider();
    byte[] hash = null;
    sha.TransformBlock(message, 0, message.Length, hash, 0);
  2. SHA1 sha = new SHA1CryptoServiceProvider();
    byte[] hash = BitConverter.GetBytes(sha.GetHashCode());
  3. SHA1 sha = new SHA1CryptoServiceProvider();
    byte[] hash = sha.ComputeHash(message);
  4. SHA1 sha = new SHA1CryptoServiceProvider();
    sha.GetHashCode();
    byte[] hash = sha.Hash;

Correct Answer: 3


Question: You are developing a class library. Portions of your code need to access system environment variables. You need to force a runtime SecurityException only when callers that are higher in the call stack do not have the necessary permissions. Which call method should you use?

  1. set.Demand();
  2. set.Assert();
  3. set.PermitOnly();
  4. set.Deny();

Correct Answer: 1


Question: You are developing a method to hash data for later verification by using the MD5 algorithm. The data is passed to your method as a byte array named message. You need to compute the hash of the incoming parameter by using MD5. You also need to place the result into a byte array. Which code segment should you use?

  1. HashAlgorithm algo = HashAlgorithm.Create(“MD5”);
    byte[] hash = algo.ComputeHash(message);
  2. HashAlgorithm algo = HashAlgorithm.Create(“MD5”);
    byte[] hash = BitConverter.GetBytes(algo.GetHashCode());
  3. HashAlgorithm algo;
    algo = HashAlgorithm.Create(message.ToString());
    byte[] hash = algo.Hash;
  4. HashAlgorithm algo = HashAlgorithm.Create(“MD5”);
    byte[] hash = null;
    algo.TransformBlock(message, 0, message.Length, hash, 0);

Correct Answer: 1


Question: You are changing the security settings of a file named MyData.xml. You need to preserve the existing inherited access rules. You also need to prevent the access rules from inheriting changes in the future. Which code segment should you use?

  1. FileSecurity security = new FileSecurity(“mydata.xml”, AccessControlSections.All);
    security.SetAccessRuleProtection(true, true);
    File.SetAccessControl(“mydata.xml”, security);
  2. FileSecurity security = new FileSecurity();
    security.SetAccessRuleProtection(true, true);
    File.SetAccessControl(“mydata.xml”, security);
  3. FileSecurity security = File.GetAccessControl(“mydata.xml”);
    security.SetAccessRuleProtection(true, true);
  4. FileSecurity security = File.GetAccessControl(“mydata.xml”);
    security.SetAuditRuleProtection(true, true);
    File.SetAccessControl(“mydata.xml”, security);

Correct Answer: 1

Tagged . Bookmark the permalink.

Leave a Reply