1. Floating Topic
  2. 11%
    1. Ch7:
    2. Ch8:
  3. 11%
    1. Ch3
    2. Ch6
    3. Ch16
  4. 11%
    1. Ch13:
    2. Ch14:
    3. Ch15:
  5. 18%
    1. Ch2: I/O
      1. DriveInfo
        1. GetDrives()
        2. Props
          1. AvailableFreeSpace Indicates the amount of available free space on a drive
          2. DriveFormat Gets the name of the file system, such as NTFS or FAT32
          3. DriveType Gets the drive type
          4. IsReady Indicates whether a drive is ready
          5. Name Gets the name of a drive
          6. RootDirectory Gets the root directory of a drive
          7. TotalFreeSpace Gets the total amount of free space available on a drive
          8. TotalSize Gets the total size of storage space on a drive
          9. VolumeLabel Gets or sets the volume label of a drive
      2. Directory static class;DirectoryInfo class
        1. GetDirectories()
        2. GetFiles()
        3. Create()
      3. File static class; FileInfo Class
        1. Create(str)
        2. CreateText(str)
        3. Copy(str, str)
        4. Move(str,str)
        5. Delete(str)
      4. FileSystemWatcher
        1. updated files
        2. new files
        3. renamed files
        4. other updates to the file system
        5. proccess
          1. fw=New FileSystemWatcher(filepath)
          2. fsw.IncludeSubdirectories = True
          3. fsw.NotifyFilter = NotifyFilters.FileName Or NotifyFilters.LastWrite
          4. AddHandler fsw.Changed, AddressOf fsw_Changed
          5. fsw.EnableRaisingEvents = True
        6. FileSystem/RenamedEventArgs
          1. the path to the updated file
          2. the type of change
        7. Changed, Created, and Deleted events
        8. Props
          1. Filter
          2. NotifyFilter
          3. FileName
          4. DirectoryName
          5. Attributes
          6. Size
          7. LastWrite
          8. LastAccess
          9. CreationTime
          10. Security
          11. Path
      5. Streams
        1. TextReader/Writer, StreamReader/Writer & TextFile
          1. File.Open/CreateText(filePath) as textReader
          2. New StreamReader(filePath)
          3. ReadLine, ReadToEnd
        2. BinaryWriter/Reader & FileStream
          1. fs=New FileStream(filepath, FileMode.Create/Read)
          2. New BinaryWriter/Reader(fs)
        3. StringWriter/Reader & StringBuilder
          1. New StringWriter(sb)
          2. New StringReader(sb.ToString())
          3. using if you have a specific reason to use streams instead of accessing the strings directly
        4. MemoryStream & StreamWriter
          1. Write/Read(byte()); Write/ReadByte(byte);
          2. New StreamWriter(ms)
        5. BufferedStream & CustomStream
          1. FileStream has the same logic
          2. Write/Read(byte()); Write/ReadByte(byte);
          3. can be used with StreamWriter
        6. GZipStream/DeflateStream
          1. Use StreamReader/Writer to deal with srings
          2. gz=New GZipStream(fileStream, CompressionMode.Compress/Decompress))
          3. New StreamWriter/Reader(gz)
        7. Close() - close and save
        8. Flush() - save without close
        9. StreamReader/Writer for text; Binary Reader/Writer for bytes
      6. System.IO.IsolatedStorage
        1. IsolatedStorageFile
          1. access the individual stores,
          2. GetUserStoreForAssembly()
          3. GetUserStoreForDomain()
          4. GetStore(scope,appidentity,evidence)
        2. IsolatedStorageFileStream
          1. individual files within a store
        3. IsolatedStorageException
        4. IsolatedStorageScope enum
          1. User
          2. Machine
          3. App Domain
          4. Application
          5. Assembly
        5. Proccess
          1. isoStore=IsolatedStorageFile.GetUserStoreForAssembly()
          2. New IsolatedStorageFileStream("myfile.txt",FileMode.Create,isoStore)
        6. not protected from highly trusted code, unmanaged code, or trusted users of the computer.
        7. should not be used to store high-value secrets
        8. requires fewer privileges
        9. IsolatedStorageFilePermission must be granted to the code
    2. Ch5: Serialization
      1. Objects
        1. Serializing
          1. the process of converting an object into a linear sequence of bytes that can be stored or transferred
        2. Deserializing
          1. the process of converting a previously serialized sequence of bytes into an object
        3. BinaryFormatter
          1. Serialize(stream,object)
          2. Deserialize(stream) as Object
          3. backward reference
          4. forward reference
        4. <Serializable()>
          1. default handling of the serialization, no other code besides the Serializable attribute is necessary.
          2. the runtime serializes all members, including private members.
          3. <NonSerialized()>
          4. temporary or calculated values to minimize storage
          5. IDeserializationCallback.OnDeserialization
          6. implement this interface on the serialisabel class
          7. <OptionalField()>
          8. if the member was not serialized, the runtime leaves the member’s value as null rather than throwing an exception.
        5. Version Compatibility
          1. Never remove a serialized field.
          2. Never apply the NonSerialized attribute to a field if the attribute was not applied to the field in a previous version.
          3. Never change the name or type of a serialized field.
          4. When adding a new serialized field, apply the OptionalField attribute.
          5. When removing a NonSerialized attribute from a field that was not serializable in a previous version, apply the OptionalField attribute.
          6. For all optional fields, set meaningful defaults using the serialization callbacks unless 0 or null are acceptable defaults.
        6. SecurityPermission with the SerializationFormatter flag
          1. not given to Internet-downloaded or intranet code
        7. IRemotingFormatter
          1. BinaryFormatter
          2. writing objects to the disk to be read later
          3. SoapFormatter
          4. more likely to successfully traverse firewalls
          5. SoapAttribute
          6. SoapDefaultValue
          7. SoapElement
          8. SoapEnum
          9. SoapIgnore
          10. SoapType
        8. Guidelines
          1. mark a class as Serializable
          2. Mark calculated or temporary members as NonSerialized
          3. Use SoapFormatter when you require portability
          4. Use BinaryFormatter for greatest efficiency
      2. Xml
        1. serialize only public class and members
        2. a parameterless constructor.
        3. cannot serialize object graphs
        4. do not have to have the Serializable attribute
        5. New XmlSerializer(Type)
        6. Attributes
          1. XmlAttribute()
          2. XmlIgnore()
          3. XmlRoot(Str)
        7. IXmlSerializable
          1. ReadXml, WriteXml to control XmlReader/Writer
          2. complete control over XML serialization
          3. separate data into bytes instead of buffering large data sets,
          4. avoid the inflation that occurs when the data is encoded using Base64 encoding
        8. XML schema file *.xsd
          1. Xsd.exe
          2. produce a set of classes that are strongly typed to the schema and annotated with attributes
          3. alternative to using XmlReader and XmlWriter classes, to parse and write an XML stream
          4. xsd C:\schema\library.xsd /classes /language:VB
        9. DataSet, Arrays, Collections and XmlElement or XmlNode classes can be serialized
      3. Custom
        1. ISerializable
          1. GetObjectData(SerializationInfo,StreamingContext)
          2. if not implemented compiler warns
          3. SerializationFormatter
          4. Sub New(SerializationInfo,StreamingContext)
          5. if not implemented serialization exception.
          6. perform data validation in serialization constructor and throw a SerializationException if invalid data is provided
          7. SerializationInfo(IFormatterConverter)
          8. AddValue(name,value)
          9. add the variables to be serialized as name/value pairs
          10. SerializationEntry
          11. to store the information
          12. IFormatterConverter
          13. FormatterConverter
          14. Binary/SoapFormatter
          15. Normal constructor is not accessable
        2. Serializable attribute
        3. serialization events for BinaryFormatter
          1. Events/Attributes
          2. <OnSerializing()> _
          3. <OnSerialized()> _
          4. IDeserializationCallback, OnDeserialization
          5. <OnDeserializing()> _
          6. <OnDeserialized()> _
          7. Events Signature
          8. Accept a StreamingContext
          9. Return void
          10. Have the attribute that matches the event
          11. <OnSerializing()> _ Private Sub CalculateTotal(StreamingContext)
          12. same serialization event to multiple methods
          13. apply multiple events to a single method
        4. StreamingContext
          1. Context prop
          2. should be assigned before serializtion or deserialization
          3. State prop
          4. CrossProcess
          5. CrossMachine
          6. File
          7. Persistence
          8. Remoting
          9. Other
          10. Clone
          11. CrossAppDomain
          12. All
          13. serialize and deserialize an object differently depending on the destination
          14. if the object is going to be deserialized by the same process
          15. can provide information about the destination of a serialized object object to classes that implements ISerializable
        5. IFormatter
          1. Binary/SoapFormatter
          2. FormatterServices
          3. http://msdn.microsoft.com/en-us /magazine/cc163902.aspx
          4. http://msdn.microsoft.com/en-us/library /cc301761.aspx
          5. http://geekswithblogs.net/luskan /archive/2007/07/16/113956.aspx
        6. Use Case
          1. the value of a member variable is invalid after deserialization but you need to provide the variable with a value to reconstruct the full state of the object
          2. has declarative or imperative security at the class level or on its constructors
      4. serilized objects can be stored/transferred and then later re-created
  6. 14%
    1. Ch9:Installing&Config apps
      1. .NET App Configuration
        1. Machine.config
          1. allowDefinition=
          2. MachineOnly
          3. MachineToApplication
        2. App.Config
        3. Defining Config Settings
          1. ConfigurationManager.OpenExeConfiguration() as Configuration
          2. Configuration.Add(Name,Value)
          3. Configuration.Save(ConfigurationSaveMode.Modified)
        4. Read Config Settings
          1. ConfigurationManager.AppSettings as NameValueCollection
          2. ConfigurationManager.ConnectionStrings as ConnectionStringSettingsCollection
          3. Name
          4. ProviderName
          5. ConnectionString
        5. Read Custom Section
          1. ConfigurationManager.OpenMachineConfiguration as Configuration
          2. obj = Configuration.GetSection(SectionName) as Object
          3. cast to <Custom>ConfigurationSection
          4. access props of <Custom>ConfigurationSection
          5. Each configuration section has a unique class
          6. obj.ElementInformation.Type.ToString
        6. Creating Custom Sections
          1. IConfigurationSectionHandler
          2. New Sub()
          3. Create(parentObj, configContextObj, sectionXmlNode) As Object
          4. Inherit ConfigurationSection
          5. use attributes to configure default values, validators, and other requirements for properties
          6. allows you to declare properties that the CLR automatically populates based on the data in the .config file
          7. <ConfigurationProperty(PropName)> _
          8. Topic
          9. Topic
          10. Topic
          11. Topic
    2. Ch10:Instrumentation
      1. Topic
        1. Topic
        2. Topic
      2. Topic
        1. Topic
          1. Topic
          2. Topic
          3. Topic
      3. Topic
      4. Topic
  7. 15%
    1. Ch1:Framework Fundamentals
      1. Value types <=16 bytes
      2. Nullable is a structure
      3. TypeForwardedTo
      4. Events
      5. EventHandler is a predefined delegate
      6. EventHandler - generic class
      7. Widening/implicit & Narrowing/explicit conversions
      8. Implement System.IConvertible
      9. Implement a TypeConverter class
      10. Boxing-Value to Ref
    2. Ch4: Collections
      1. Hashtable constructor - IEqualityComparer
      2. StringComparer.InvariantCulture implements IEqualityComparer
      3. SortedList constructor - IComparer
      4. HybridDictionary=ListDictionary+Hashtable
      5. SortedList is sorted
      6. OrderedDictionary is not sorted
      7. BitVector32 and BitPacking to store int32
      8. CollectionUtil factory will create case insesitive Hashtable and SortedLilst
      9. NameValueCollection stores comma separated multiple values per key
  8. 20%
    1. Ch11:App Security
      1. Code access security (CAS) - .Net system
        1. CAS -managed app, partially trusted; RBS-unmanaged app, fully trusted
        2. Evidence -> Code Groups (Zone) -> Permission Set (ACL)
        3. Evidence
          1. host evidence -assembly’s origin; assembly evidence -developer provided
          2. Types
          3. location-directory or site or url
          4. hash of code
          5. publisher’s signature
          6. strong name-namespace
          7. zone -code group
        4. Permissions
          1. Directory Services - Active Directory settings
          2. Web requests;
          3. DNS requests;
          4. File Dialog
          5. Message queues
          6. Performance counters
          7. Reflection
          8. Security - Enabel Assembly Execution, run unmanaged code, control threads
          9. Service Conroller -win services
          10. Socket Access - TCP/IP control
          11. SQL Client
          12. User Interface
          13. User Interface - create new windows, clipboard
          14. X509 Store - certificate store
          15. I/O
        5. Access control list (ACL) is Permission Set
          1. FullTrust
          2. SkipVerification
          3. Everything
          4. LocalIntranet - wide ACL
          5. Internet -restricted ACL
          6. Execution
          7. Nothing
        6. Code Group is part of Evidence
          1. My_Computer_Zone
          2. LocalIntranet_Zone
          3. Internet_Zone
          4. Restricted_Zone
          5. Trusted_Zone
        7. Security Policy
          1. Enterprise
          2. Machine
          3. User
          4. Application Domain
        8. .NET Framework Configuration tool Code Access Security Policy tool (Caspol.exe)
          1. Evaluating an assembly to determine which code groups it is a member of
          2. Evaluating an assembly to determine which permissions it will be assigned
          3. Adding new permission sets
          4. Adding new code groups
          5. increasing an assembly’s trust
          6. Adjusting zone security
          7. Resetting policy levels
        9. PermissionState.None/PermissionState.Unrestricted
      2. CAS Assembly Declarations
        1. SecurityAction.RequestMinimum
          1. To avoid unxpected exceptions
          2. System.Security.Policy.PolicyException
        2. SecurityAction.RequestOptional
          1. Refuses all permissions not listed in a SecurityAction.RequestOptional/SecurityAction.RequestMinimum
          2. exception will be thrown while accesing (ie READING) the file
        3. SecurityAction.RequestRefuse
          1. No Exception
          2. The principle of least privilege.
        4. Properties
          1. Action
          2. Unrestricted
          3. Permission attribute classes inherited CodeAccessSecurityAttribute
          4. DataProtectionPermission
          5. GacIdentityPermission
          6. KeyContainerPermission
          7. StorePermission
          8. AspNetHostingPermission
          9. IUnrestrictedPermission
          10. PrincipalPermission
      3. CAS Method Imperative/Declarative
        1. Permission.Assert
          1. Ignore the fact that callers might not have the specified permission
          2. SecurityPermissionFlag.Assertion assebly setting
          3. when you want to allow partially trusted code to call a method that requires permissions the caller might lack. Review your code carefully for potential security vulnerabilities;
          4. enable a method to vouch for all callers
          5. Can be used only ONCE in a method
          6. to assert multiple permissions, you need to create a custom permission set
        2. Permission.Demand
          1. Throw an exception if the caller and all callers higher in the stack lack the specified permission.
          2. assembly implements customized functionality that does not rely on functionality built into the .NET Framework, such as calls to unmanaged code.
          3. Avoid redundant demands Most .NET classes automatically demands permissions like StreamWriter
        3. Permission.LinkDemand
          1. throw an exception if the immediate caller, but not callers higher in the stack, lack the specified permission
        4. Permission.InheritanceDemand
          1. throw an exception if the assembly inheriting from the class lacks the specified permission
        5. Permission.Deny
          1. further refine the permissions available to each method
        6. Permission.PermitOnly
          1. reduce the method’s access by removing all permissions except for the specified permission
          2. limit the permissions available toeach method. List every permission the method requires.
        7. CodeAccessPermission.RevertAll/Assert/PermitOnly/Deny
          1. imperatively reduce permissions when a section of a method requires fewer permissions than the rest of the method. This is particularly important when calling objects created by third parties.
      4. Imperative vs Declarative
        1. declarative security demands are less secure than imperative
        2. declarative demands are faster than imperative demands
        3. Declarative - compiler performs security checks prior to running code
        4. Imperative-code itself performs security checks
        5. imperative demands is that you can catch the security exception within your method
        6. Declarative security criteria must be static, imperative - dynamic
      5. System.Security.SecurityManager.IsGranted
      6. PermitOnly - error-handling routines
      7. SecurityPermissionFlag.Assertion assebly setting
        1. The FullTrust, LocalIntranet, and Everything permission sets
      8. AllowPartiallyTrustedCallersAttribute
        1. To prevent partially trusted code from bypassing security checks, partially trusted code can’t call strong-named assemblies by default.
      9. Access control list (ACL) is Permission Set
    2. Ch12: User&Data Security
      1. Role-based security (RBS)
        1. WindowsIdentity
          1. Get Anonymous
          2. Get Current
          3. Impersonate
          4. AuthenticationType
          5. IsAnonymous
          6. IsAuthenticated
          7. IsGuest
          8. IsSystem
          9. Name
          10. Token
        2. WindowsPrincipal
          1. Init thru constructor
          2. New WindowsPrincipal(WindowsIdentity.GetCurrent())
          3. Init thru CurrentThread
          4. AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal) Dim currentPrincipal As WindowsPrincipal=CType(Thread.CurrentPrincipal, WindowsPrincipal)
          5. IsInRole()
          6. accepts WindowsBuiltInRole class
          7. accepts string like “DOMAIN\Group Name”
        3. PrincipalPermission Class/Attribute
          1. Authenticated
          2. Name
          3. Role
          4. PrincipalPermission.Demand
        4. Declarative RBS demands
          1. Cons
          2. restrict access to entire methods
          3. the runtime throwing an exception.
          4. Elements
          5. CurrentDomain.SetPrincipalPolicy
          6. Try/Catch block
          7. PrincipalPermission attribute
          8. PrincipalPermission
          9. System.Security.Permissions.SecurityAction.Demand
          10. Name/Role/Authenticated
          11. Multiple declarative demands
        5. Imerative RBS demands
          1. Elements
          2. CurrentDomain.SetPrincipalPolicy
          3. Try/Catch block
          4. PrincipalPermission class instance
          5. PrincipalPermission.Demand
          6. PrincipalPermission constructors
        6. Custom Users&Roles
          1. IIdentity
          2. AuthenticationType
          3. IsAuthenticated
          4. Name
          5. Constructor that defines the props
          6. IPrincipal
          7. New( IIdentity, String())
          8. IsInRole(String) As Boolean
          9. Identity() as IIdentity
          10. Roles;IsInAll/AnyRole;IsHigher/LowerThanRole
          11. GenericIdentity/Principals
          12. Name;Name,AuthenticationType
          13. GenericIdentity,Strings()
          14. props are assigned only thru constructor
          15. Thread.CurrentPrincipal=IPrincipal object
        7. NegotiateStream/SslStream
          1. AuthenticationException
          2. InvalidCredentialException
        8. File System; Registry; Printers;Event Logs; System.Security.Principal
        9. This applies for usernames and roles stored either in local user database, or within an Active Directory domain
      2. Access Control List (ACL)
        1. Discretionary Access Control Lists (DACL)
          1. access control entries (ACEs)
          2. Explicit/Inherited Permissions
          3. each new folder you create in the root C:\ folder inherits the exact permissions assigned to the C:\ folder
          4. assign a DACL directly to an object, you create an explicit permission
          5. Calculates Effective Permissions
          6. The maximum granted access permission applied
          7. explicitly denied access in higher priority
          8. no explicit access means deny by default
          9. FileSystemRights enum
          10. Full Control
          11. Delete
          12. Read & Execute
          13. RegistryRights enum
          14. Full Control
          15. Delete
          16. Query Values
          17. AccessControlType enum
        2. Security Access Control List (SACL)
          1. Enable Audit Object Access security policy
          2. Open the Local Security Policy console from within Administrative Tools.
          3. Expand Local Policies and click Audit Policy.
          4. In the right pane, double-click Audit Object Access. Select Failure to enable failure auditing, and select Success to enable success auditing.
        3. System.Security.AccessControl
          1. <Type>Security
          2. GetAccessRules
          3. collection of DACLs
          4. GetAuditRules
          5. Add/RemoveAccessRule , Add/RemoveAuditRule
          6. <Type>AccessRule
          7. set of access rights allowed or denied for a user or group.
          8. <Type>AuditRule
          9. set of access rights to be audited for a user or group
          10. AuthorizationRuleCollection of <Type>AccessRule / <Type>AuditRule
          11. for files, folders, registry keys, cryptographic keys, Event Wait handles, mutexes, and semaphores.
        4. <Type>.GetAccessControl
        5. <Type>.SetAccessControl
        6. files, folders, registry keys, cryptographic keys, Event Wait handles, mutexes, and semaphores.
      3. Ecrypting/Decrypting
        1. Symmetric key encryption
          1. Classes
          2. TripleDES
          3. RijndaelManaged- AES
          4. recommended to use
          5. RC2
          6. replace DES
          7. Data Encryption Standard - DES
          8. Props
          9. BlockSize,FeedbackSize,KeySize
          10. IV -initialization vector
          11. both the encryptor and decryptor must specify the same value
          12. statically define
          13. or derive from the Key property
          14. Key
          15. can be automatically generated
          16. can be derived from string(login+password)
          17. LegalBlockSizes
          18. LegalKeySizes
          19. Mode
          20. Padding
          21. Methods
          22. CreateDecryptor/Encryptor
          23. CryptoStream object
          24. CryptoStreamMode.Write/Read
          25. GenerateIV/Key
          26. ValidKeySize
          27. Rfc2898DeriveBytes(pswd,salt)
          28. PasswordDeriveBytes
          29. requres pswd,salt, iv, number of iterations used to generate the key
          30. GetBytes(myAlg.KeySize / 8)
          31. GetBytes(myAlg.BlockSize / 8)
          32. Key/BlockSize returns bits but GetBytes needs length in bytes
          33. Process
          34. Create a Stream objects
          35. Create a SymmetricAlgorithm object
          36. Specify the algorithm’s key, the IV, or both
          37. Call SymmetricAlgorithm.CreateEncryptor/Decryptor()
          38. Create a CryptoStream
          39. Read from/ write to the CryptoStream
          40. // Read the unencrypted file into fileData byte[] fileData = new byte[inFile.Length]; inFile.Read(fileData, 0, (int)inFile.Length);
          41. Key, IV, Mode - should be the same on Encryptor and Decryptor
        2. Asymmetric encryption
          1. Based on private key - to decrypt and Public key to encrypt
          2. Used to synchronise private key of symmetric encryption - SSL & HTTPS
          3. A public key infrastructure PKI is an infrastructure for distributing, managing, and revoking certificates in an organization
          4. Keys are big and doen't suit for bug amount of data
          5. Classes
          6. RSACryptoServiceProvider
          7. DSACryptoServiceProvider
          8. Props
          9. KeyExchangeAlgorithm
          10. KeySize,LegalKeySizes
          11. SignatureAlgorithm
          12. PersistKeyInCsp
          13. UseMachineKeyStore
          14. Methods
          15. Decrypt/Encrypt
          16. ExportParameters(boolean)
          17. returns RSAParameters structure
          18. To/FromXmlString
          19. ImportParameters(RSAParameters)
          20. SignData(byte()/stream,object) As Byte()
          21. SignHash(byte(),str) As Byte()
          22. VerifyData/Hash
          23. RSAParameters structure
          24. D
          25. Exponent - e
          26. Modulus - n
          27. Export your private key only if you need to reuse it later. application must protect the privacy of the private key.
          28. Store Key Pairs for Later Reuse
          29. New CspParameters()
          30. CspParameters.KeyContainerName=str
          31. new RSACryptoServiceProvider(persistantCsp)
          32. RSACryptoServiceProvider.PersistKeyInCsp=true
          33. .NET Framework handles creating and retrieving keys automatically
          34. RSACryptoServiceProvider.Encrypt/Decrypt(byte[],bool)
          35. Dim messageString As String = "Hello, World!" Dim myRsa As RSACryptoServiceProvider = New RSACryptoServiceProvider
          36. Dim messageBytes As Byte() = Encoding.Unicode.GetBytes(messageString) Dim encryptedMessage As Byte() = myRsa.Encrypt(messageBytes, False)
          37. Dim decryptedBytes As Byte() = myRsa.Decrypt(encryptedMessage, False) Console.WriteLine(Encoding.Unicode.GetString(decryptedBytes))
        3. Data Hashes
          1. verify that a file has not been modified
          2. enable passwords to be verified without storing the password itself
          3. HashAlgorithm
          4. MD5CryptoServiceProvider
          5. The Message Digest algorithm
          6. RIPEMD160Managed
          7. SHA1CryptoServiceProvider
          8. SHA256/384/512Managed
          9. KeyedHashAlgorithm
          10. HMACSHA1
          11. Hash-based Message Authentication Code using SHA1
          12. MACTripleDES
          13. Message Authentication Code using TripleDES
          14. protect against modification of the hash by encrypting
          15. Process NonKey
          16. myHash=New MD5CryptoServiceProvider()
          17. myHash.ComputeHash(byte())
          18. myHash.Hash as byte()
          19. Process with Key
          20. key = New Rfc2898DeriveBytes(str, byte())
          21. secretKey = key.GetBytes(16)
          22. myHash=New HMACSHA1(secretKey)
          23. myHash.ComputeHash(byte())
        4. Data Signing
          1. DSA/RSACryptoServiceProvider
          2. SignHash/SignData VerifyHash/VerifyData
          3. Signing
          4. signer=New DSACryptoServiceProvider()
          5. signer.SignData(byte())
          6. publicKey = signer.ToXmlString(False)
          7. Verifying
          8. verifier = new DSACryptoServiceProvider()
          9. verifier.FromXmlString(publicKey)
          10. verifier.VerifyData(byte(), signature)
          11. authenticate the identity of a sender
        5. the strongest defaults available to the run-time environment