Insert Values Into The URL With C#

This method will help you when you need to insert parameters into the URL string.


public static string InsertURLParameters(string url, int listItemID, Page returnToPage)
        string firstInjection = SharePointTools.InsertURLParameters(url, listItemID, false);
        string formatInjection = string.Format(“Source={0}”, SPEncode.UrlEncode(returnToPage.Request.Url.AbsoluteUri));
        return InsertURLParameters(firstInjection, formatInjection, false);

public static string InsertURLParameters(string url, string parameters, bool insertInFront)
        if (url.IndexOf(‘?’) >= 0)
                if (insertInFront)
                        url = url.Replace(“?”, string.Format(“?{0}&”, parameters));
                        return url;
                url = url + string.Format(“&{0}”, parameters);
                return url;
        url = url + string.Format(“?{0}”, parameters);
        return url;



Introduction To IPSec

Introduction To IPSec

For most organizations, the C and I of the CIA security model (confidentiality and integrity) when traversing a network medium, or collaboration environment, are exceedingly imperative. Therefore, it is crucial to protect frames as they are funneled during transit between various machines on your SharePoint network.

The protection schemes defined will typically take place at the Layer 2 or Layer 3 of the OSI model which has been detailed in previous articles (please read the OSI model and SharePoint article for a better idea of how the OSI model is structured). Although there is obviously a layer of abstraction between the assorted OSI layers and the ones that SharePoint primarily interacts with (those related to interface transformation), it is nonetheless an important concept to understand in relation to proper security implementation for your SharePoint environment.

IPSec As A Network Security Protocol
IPSec is a principal network layer security protocol, and it allows the idea of multiple as well as concurrent tunneling schemes. The chief purpose of IPSec as a security protocol is to procure functionality that will encrypt and authenticate various IP packets as they are transmitted across an arbitrary medium, particularly those that are involved with your calibration environment.

Although an add-on is obtainable for legacy IP schemes such as the IPv4 standard, IPSec is built directly into the IPv6 standard (which is a common future rollout for organizations), procuring a more uniform, secure transmission security protocol. Although there are other germane network security standards (discussed in other articles) such as PPTP and L2TP, these protocols were mostly targeted at dial-up functionality such as VPN’s, whereas IPsec was built from the ground-up as a networked computing standard for a true associated environment.

Though it is still possible to use IPsec on VPN targeted environments (across IPSec-compatible VPN devices that are implementing on the DMZ a.k.a. a VPN gateway), IPSec is not a multi-protocol based standard and is targeted for strictly for IP encryption, although IPSec is based on a modular framework and allows several levels of flexibility to work with its base characteristics.

Tunnel and Transport Mode
There are two focal operational modes that exist with IPSec, Tunnel Mode and Transport Mode. Tunnel mode means that the complete layer 3 packet is encrypted and packaged in the IPsec packet. Transport mode means that the layer 3 payload is encrypted, however the IP headers are left as they are during a customary transport instantiation.

Authentication Header and Encapsulating Security Payload

There are two security protocols that manufacture IPSec, Authentication Header (AH) and Encapsulating Security Payload (ESP). Authentication Header is the protocol which provides data origin authentication, anti-replay, and connectionless integrity. The overall concept to understand regarding Authentication Header is that it provides no confidentiality services, and is not meant to target this specific faculty by design. Encapsulating Security Payload provides data origin authentication and anti-replay as well, but also provides faculties for confidentiality and connectionless integrity, and therefore has some facets that differentiate it from its former.

Security Associations
A security association in the realm of IPSec is a relationship that is procured between two or more entities, and provides the description as to how the entities will leverage the relevant security services that subsist in order to assemble secure communications.

Internet Key Exchange (IKE)

The security associations that are described in the above section require that there be existent a protocol that can facilitate the negotiations between entities that leverage the various described security associations. The IKE process requires that the relevant IPSec systems authenticate relevantly in order to establish the sharing of pertinent keys. There are two strategic phases that are involved in the key exchange in the IKE progression:

Phase 1
Between two applicable peers, the IKE will generate a secure channel known as the IKE security association, described in the above section more exhaustively. During this process, the Difffie-Hellman key agreement is leveraged.

In phase 1, there are three major methods that are used when authenticating to IPsec cohorts, pre-shared keys where the party will manually enter the key value, RSA signatures which leverage digital certificates sponsored by an RSA signature, and RSA encrypted nonces, which will use RSA encryption to encrypt a nonce value (random numeric).

Phase 2 During Phase 2, IKE will perform handshaking of security associations and engender the relevant key material needed for the IPSec service. The sender of the handshake will present a singular transform set (or more if needed as determined by the IKE process) which are leveraged in order to tolerate a combination of transforms regarding relevant settings. As well, the sender of the handshake will designate the data flow for which the transform set should pertain to.

The receiver of the handshake will transmit one transaction set that will specify the reciprocally arranged transforms and relevant algorithms for the established session. Lastly, there may be a new Diffie-Hellman key agreement established or the one generated from the phase one can be inherited.

The IPsec Process

The IPsec process can commonly broken down into five major steps that generate the overall process, including pertinent handshaking and termination proceedings.

  • Initialization Relevant traffic that deems it is necessary will instantiate the IPSec service. The service can be tripped by constructing an IPSec security policy that will trip the IKE process.
  • Phase 1 of IKE The authentication process that IKE users will authenticate the parties involved and the initial negotiation of the IKE will begin. This negotiation will be leverage by Phase 2 of the IKE process.
  • Phase 2 of IKE IKE will broker the negotiation of the security associations and there will be a generation of security associations of relevant peers.
  • Data Transfer The actual data is transmitted based on IPSec and the relevant IKE settings.
  • Tunnel Drop The IPSec security associations are dropped for any number of reasons as determined by the transaction state