All-In-One Security Code Samples

Introduction

The All-In-One Security code samples demonstrate the typical programming topics about security e.g. UAC, encryption, decryption. These topics are either frequently asked in MSDN forums and Microsoft Support, or are requested by many developers via our code sample request function. We want to alleviate the frustration felt by developers when they are dealing with security.

   

Visual Studio 2008 Code Samples

Sample Description Download ReadMe
CppCreateLowIntegrityProcess The code sample demonstrates how to start a low-integrity process. Download ReadMe.txt
CppImpersonateUser This VC++ code sample demonstrates how to impersonate the user represented by a specified user token using the LogonUser API and the ImpersonateLoggedOnUser API. Download ReadMe.txt
CppResourceIntegrityLevel This sample demonstrates how to check and modify resource integrity level for a securable object. Download ReadMe.txt
CppRunAsUser This sample demonstrates how to create an interactive process running as a different user account. Download ReadMe.txt
CppUACSelfElevation This example demonstrates how to check the privilege level of the current process, and how to self-elevate the process by giving explicit consent with the Consent UI. Download ReadMe.txt
CSCreateLowIntegrityProcess The code sample demonstrates how to start a low-integrity process. Download ReadMe.txt
CSCustomAuthorization This sample demonstrates how to implement custom authentication and authorization by using classes that derive from IIdentity and IPrincipal. Download ReadMe.txt
CSDigitalSignature This sample demonstrates how to use .NET built-in classes to implement Digital Signature for data. Download ReadMe.txt
CSEncryption This sample demonstrates how to use .NET built-in classes to encrypt and decrypt data. Download ReadMe.txt
CSImpersonateUser This VC# code sample demonstrates how to impersonate the user represented by a specified user token using the LogonUser API and the ImpersonateLoggedOnUser API. Download ReadMe.txt
CSUACSelfElevation This example demonstrates how to check the privilege level of the current process, and how to self-elevate the process by giving explicit consent with the Consent UI. Download ReadMe.txt
CSXmlDigitalSignature This sample demonstrates how to use .NET built-in classes to implement Digital Signature for Xml documents. Download ReadMe.txt
CSXmlEncryption This sample demonstrates how to use .NET built-in classes to encrypt and decrypt Xml document. Download ReadMe.txt
VBCreateLowIntegrityProcess The code sample demonstrates how to start a low-integrity process. Download ReadMe.txt
VBImpersonateUser This VB code sample demonstrates how to impersonate the user represented by a specified user token using the LogonUser API and the ImpersonateLoggedOnUser API. Download ReadMe.txt
VBUACSelfElevation This example demonstrates how to check the privilege level of the current process, and how to self-elevate the process by giving explicit consent with the Consent UI. Download ReadMe.txt

Download all code samples: http://1code.codeplex.com/releases

 

Submit your request of Security code samples (Guidance)