2013年微軟70536認證題庫及答案3

字號:

為大家收集整理了《2013年微軟70536認證題庫及答案3》供大家參考,希望對大家有所幫助?。。?BR>    11 .
    您正在開發(fā)一個方法,以使用數據加密標準(DES) 算法對敏感數據進行加密。您的方法接受下列參數:
    ·名為message 的待加密的字節(jié)數組
    ·名為key 的加密密鑰
    ·名為iv 的初始化向量
    您需要對數據加密。您還需要將加密數據寫入MemoryStream對象。
    您應該使用哪個代碼段?
    A.
    DES des = new DESCryptoServiceProvider();
    des.BlockSize = message.Length;
    ICryptoTransform crypto = des.CreateEncryptor(key, iv);
    MemoryStream cipherStream = new MemoryStream();
    CryptoStream cryptoStream = new CryptoStream(cipherStream, crypto, CryptoStreamMode.Write);
    cryptoStream.Write(message, 0, message.Length);
    B.
    DES des = new DESCryptoServiceProvider();
    ICryptoTransform crypto = des.CreateDecryptor(key, iv);
    MemoryStream cipherStream = new MemoryStream();
    CryptoStream cryptoStream = new CryptoStream(cipherStream, crypto, CryptoStreamMode.Write);
    cryptoStream.Write(message, 0, message.Length);
    C.
    DES des = new DESCryptoServiceProvider();
    ICryptoTransform crypto = des.CreateEncryptor();
    MemoryStream cipherStream = new MemoryStream();
    CryptoStream cryptoStream = new CryptoStream(cipherStream, crypto, CryptoStreamMode.Write);
    cryptoStream.Write(message, 0, message.Length);
    D.
    DES des = new DESCryptoServiceProvider();
    ICryptoTransform crypto = des.CreateEncryptor(key, iv);
    MemoryStream cipherStream = new MemoryStream();
    CryptoStream cryptoStream = new CryptoStream(cipherStream, crypto, CryptoStreamMode.Write);
    cryptoStream.Write(message, 0, message.Length);
    答案:D
    12.
    你正在開發(fā)一個審計應用程序,以顯示計算機上安裝的受信任的ClickOnce 應用程序。
    你需要審核應用程序來顯示每個可信任應用程序的來源。
    你應該使用哪個代碼段?
    A.
    ApplicationTrustCollection trusts;
    trusts = ApplicationSecurityManager.UserApplicationTrusts;
    foreach (ApplicationTrust trust in trusts)
    {
    Console.WriteLine(trust.ToString());
    }
    B.
    ApplicationTrustCollection trusts;
    trusts = ApplicationSecurityManager.UserApplicationTrusts;
    foreach (ApplicationTrust trust in trusts)
    {
    Console.WriteLine(trust.ExtraInfo.ToString());
    }
    C.
    ApplicationTrustCollection trusts;
    trusts = ApplicationSecurityManager.UserApplicationTrusts;
    foreach (ApplicationTrust trust in trusts)
    {
    Console.WriteLine(trust.ApplicationIdentity.FullName);
    }
    D.
    ApplicationTrustCollection trusts;
    trusts = ApplicationSecurityManager.UserApplicationTrusts;
    foreach (object trust in trusts)
    {
    Console.WriteLine(trust.ToString());
    }
    答案: C
    13.
    你為工作目錄創(chuàng)建一個DirectorySecurity對象。你需要標識具有讀寫權限的用戶帳號和組。
    你應該對DirectorySecurity對象使用哪種方法?
    A.
    GetAuditRules 方法
    B.
    GetAccessRules 方法
    C.
    AccessRuleFactory方法
    D.
    AuditRuleFactory方法
    答案: B
    14.
    您創(chuàng)建一個通過使用最終用戶憑據運行的方法。您需要使用Microsoft Windows 組向用戶授權。您必須添加代碼段,該代碼段確定用戶是否在名為Clerk的本地組中。
    您應該使用哪個代碼段?
    A.
    WindowsIdentity currentUser = WindowsIdentity.GetCurrent();
    foreach (IdentityReference grp in currentUser.Groups) {
    NTAccount grpAccount = ((NTAccount)grp.Translate(typeof(NTAccount)));
    isAuthorized = grpAccount.Value.Equals(Environment.MachineName + @"\Clerk");
    if(isAuthorized)
    break;
    }
    B.
    WindowsPrincipal currentUser = (WindowsPrincipal)Thread.CurrentPrincipal;
    isAuthorized = currentUser.IsInRole("Clerk");
    C.
    GenericPrincipal currentUser = (GenericPrincipal) Thread.CurrentPrincipal;
    isAuthorized = currentUser.IsInRole("Clerk");
    D.
    WindowsPrincipal currentUser = (WindowsPrincipal)Thread.CurrentPrincipal;
    isAuthorized = currentUser.IsInRole(Environment.MachineName);
    答案: B
    15.
    你正在開發(fā)一個通過最終用戶的憑證運行的應用程序。只有作為Administrator組成員的用戶才有權運行該應用程序。你編寫以下的安全代碼,以保護該應用程序中的敏感數據。
    bool isAdmin=false;
    WindowsBuiltInRole role=WindowsBuiltInRole.Administrator;
    ......
    if(!isAdmin)
    throw new Exception("User not permitted");
    您需要向此安全代碼中添加一個代碼段,以確保該應用程序會在用戶不是Administrator的組的成員引發(fā)異常。
    你應該使用哪個代碼段?
    A.
    WindowsPrincipal currentUser = (WindowsPrincipal)Thread.CurrentPrincipal;
    IsAdmin= currentUser.IsInRole(role);
    B.
    WindowsIdentity currentUser = WindowsIdentity.GetCurrent();
    foreach (IdentityReference grp in currentUser.Groups) {
    NTAccount grpAccount=((NTAccount)grp.Translate(typeof(NTAccount)));
    isAdmin=grp.Value.Equals(role);
    if (isAdmin)
    break;
    }
    C.
    GenericPrincipal currentUser = (GenericPrincipal) Thread.CurrentPrincipal;
    IsAdmin = currentUser.IsInRole(role.ToString());
    D.
    WindowsIdentity currentUser = (WindowsIdentity)Thread.CurrentPrincipal.Identity;
    isAdmin=currentUser.Name.EndsWith("Administrator");
    答案:A