08.01.2015 Views

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 10 ■ .<strong>NET</strong> 3.0: PROGRAMMING WITH CARDSPACE 241<br />

This registers the DLL for you. Using /s does a silent installation, where you don’t get<br />

the various status updates.<br />

CAPICOM.dll is the implementation of the CAPICOM security layer, which allows for<br />

easy integration of security, digital signing, <strong>and</strong> encryption onto web pages. It is part of<br />

the Windows SDK, <strong>and</strong> can be found in the Bin directory. It provides a COM interface to<br />

the Microsoft CryptoAPI <strong>and</strong> exposes a set of its functions allowing for easy incorporation<br />

of digital signing <strong>and</strong> encryption into your programs. It provides support for smart<br />

cards, software keys, verification of digitally signed data, certificates, <strong>and</strong> more. It’s well<br />

worth a look at its functions, but a deep dive goes beyond the scope of this book. However,<br />

the SDK documentation is a great place to start if you are serious about security in<br />

your web applications.<br />

Step 2: Installing Certificates<br />

The next function that the batch file performs is installing the certificates that are necessary<br />

to allow the site to be authenticated <strong>and</strong> trusted with HTTPS in the browser. This is<br />

performed by the install-certificates.vbs script.<br />

The SDK ships with four sample certificates, used by the following URLs:<br />

https://www.contoso.com<br />

https://www.fabrikam.com<br />

https://www.woodgrovebank.com<br />

https://www.adatum.com<br />

When you browse to a site, the certificate has to match the site—so if you visit<br />

http://localhost <strong>and</strong> it is certified by a certificate from https://www.contoso.com, you will<br />

get an error in the browser. This offers you two levels of security. The first is that Internet<br />

Explorer will present you with a blocking page letting you know that there is a problem<br />

with the certificate (see Figure 10-9).<br />

This security measure is in place to prevent a “bad” site from delivering the certificate<br />

from a “good” site <strong>and</strong> betraying the user’s trust. However, Internet Explorer still<br />

gives you the choice to proceed to the site, but lets you know that it isn’t recommended.<br />

Should you decide to do this, you’ll see another visual indicator that there is a problem<br />

with the site—the address bar is colored red <strong>and</strong> a certificate error is highlighted (see<br />

Figure 10-10).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!