Persits Software, Inc. Web Site
Main Menu:  Home |  News |  Manual |  Object Reference |  Crypto 101 |  Download & Buy |  Live Demo |  Support |  Contact
 Navigator:  Home |  Object Reference |  XEncrypt Object
  XEncrypt Object
XEncrypt is an invisible client-side ActiveX control that exposes the same properties and methods as CryptoManager (with a few exceptions). This control enables you to perform all the cryptographic operations inside the IE browser directly on the client's machine. This is particularly useful for operations involving the user's private key such as digital signing and data decryption.

Unlike CryptoManager, XEncrypt does not require a registration key, so it can be freely downloaded to the client's machine. This control conveniently resides in the same DLL (aspencrypt.dll) as the rest of the AspEncrypt objects.

XEncrypt can only be used inside IE and not any other container. You must use CryptoManagager for VB and other development environments.

To use XEncrypt on the client side of your Web-based application, you must place the file aspencrypt.dll in a virtual directory where a client browser can find and download it. The easiest method is to place the file in the same virtual directory as an HTML or ASP file that references it. Your HTML or ASP file must reference XEncrypt as follows:


For more information, see Chapter 8: XEncrypt - Client-side ActiveX Control.

Properties Methods
Exposes the same properties as CryptoManager except Expires. Exposes the same methods as CryptoManager except LogonUser and RevertToSelf. Additional method:

  XEncrypt Properties
XEncrypt exposes the same properies as CryptoManager except for Expires and RegKey (since this control never expires and does not need a registration key).

  XEncrypt Methods

XEncrypt exposes the same methods as CryptoManager except LogonUser and RevertToSelf (because there is no need for impersonation on the client side). Additional method:

Function PickCertificate ( Store As CryptoStore, Flags As Long, Caption As String, Message As String ) As CryptoCert
This method uses the undocumented CryptoAPI function CryptUIDlgSelectCertificateW which displays a list of certificates from a certificate store specified by Store.

Flags specifies what columns are to be displayed in the certificate dialog. If Flags is 0, all 6 columns are to be displayed:

Issued to
Issued by
Intended Usage
Friendly Name
Expiration Date

To hide any of these columns, use a combination (sum) of the following flags:

&H01 hides "Issued to"
&H02 hides "Issed by"
&H04 hides "Indended Usage"
&H08 hides "Friendly Name"
&H10 hides "Location"
&H20 hides "Expiration Date"

For example, the value 28 (&H04 + &H08 + &H10 = &H1C) hides all columns except Issued to, Issued by and Expiration Date.

Caption, if set to a non-empty string, specifies the caption of the certificate dialog. If an empty string is specified, the default caption will be displayed.

Message, if set to a non-empty string, specifies the message inside the dialog above the certificate list. If an empty string is specified, the default message will be displayed.

Returns a CryptoCert object representing the user-selected certificate, or Nothing if the user clicks Cancel.


Set Store = XEncrypt.OpenStore("MY", False)
Set Cert = XEncrypt.PickCertificate(Store, _
  28, "Select Certificate Please", _
  "Select the one you want to be used for signing")

Related Tasks: 8.4 Signing with Personal Certificates.


  This site is owned and maintained by Persits Software, Inc. Copyright © 2000 - 2010. All Rights Reserved.