Key Archival and Recovery
Any front desk clerk at a hotel will tell you that people cannot be totally trusted with keys. They get lost, washed, ironed, or simply left on the wrong side of a door with an automatic lock.
Providing a central repository for replacement keys is a tricky proposition. If this repository were to be compromised, the entire PKI would be useless. Worse than useless, actually, because it may still seem to be reliable as the bad guys plunder the encrypted files and email messages.
Still, the ability to maintain continued access to data in the face of user neglect or mistake makes a secure key repository a highly attractive feature. Standard PKI has defined such a creature. It is called a Registration Authority, or RA. For many years, Microsoft has provided a Registration Authority for Exchange users in the form of the Key Management Service, or KMS. This service stores copies of users' mail encryption keys where they can be re-issued, if necessary.
The KMS in Exchange 2000 is an add-on to a Windows 2000 CA. With Windows Server 2003, Microsoft includes a Registration Authority directly in the CA service. The next version of Exchange will dispense with the KMS and use the Windows Server 2003 RA. In fact, there is even a migration utility to transfer the KMS database to a Windows Server 2003 CA.
The CA can only store encryption keys for re-issue. Digital signature keys cannot be re-issued because that defeats the non-repudiation feature of a signature. If you could store digital signature private keys, a sender accused of sending a malicious message could make the case that it was an administrator with access to the key repository that sent the message.
Key recovery requires the use of an enterprise-level certificate template called Key Recovery Agent. For this reason, you cannot do key recovery on a standalone CA. Only Enterprise CAs have access to templates. Also, by default, only Domain Admins or Enterprise Admins have access to the Key Recovery Agent template. This is controlled by permissions on the template in Active Directory. You can access the template via the AD Sites and Services console with the VIEW | SERVICES NODE option enabled. The template object is located in Services | Public Key Services | Certificate Templates. Change the permissions on the template to permit other administrative groups to issue Key Recovery certificates.
Key recovery is not enabled by default. In fact, enabling key recovery turns out to be a relatively complicated process, much more so than it should be. Here are the stages:
Create a Key Recovery Agent. This account is issued a certificate authorizing it to generate and certify public/private key pairs on behalf of users. Recall that the normal key certification process requires that the user account generate the key pair then request certification for the public key.
Configure a CA to archive keys and to permit key recovery.
Issue a new template that will be used in lieu of the standard User template for generating archival certificates.
Create a Key Recovery Agent
Configuring a CA to issue Recovery Agent certificates involves loading the Key Recovery Agent template from the template cache in Active Directory into the template cache at the CA. You then use this template to issue a certificate to the Key Recovery account you have selected. Use the steps in Procedure 18.3 to create a Key Recovery Agent.
Procedure 18.3 Creating a Key Recovery Agent
Open the Certification Authority console.
Right-click Certificate Templates and select New | Certificate Template to Issue. The Enable Certificate Templates window opens (see Figure 18.23).
Figure 18.23. Enable Certificate Templates window showing the Key Recovery Agent template.
Click OK to load the template. It now appears in the right pane of the Certification Authority console.
Log on at the workstation you will use for Key Recovery using the account you have selected as the Key Recovery Agent.
Open the Certificates snap-in and expand the tree to PERSONAL | CERTIFICATES.
Right-click the Certificates icon and select NEW | REQUEST NEW CERTIFICATE from the flyout menu. The Certificate Request Wizard starts.
Click Next. The Certificate Types window opens. Select Key Recovery Agent.
Click Next. The Certificate Friendly Name and Description window opens.
Click Next. A summary window opens.
Click Finish to complete the transaction and close the wizard. You get a message that the request was received by the CA and the certificate will be issued when approved by the Certificate Manager.
In the Certification Authority console, select the Pending Requests icon. The certificate request is displayed in the right pane.
Right-click the certificate request icon and select ALL TASKS | ISSUE from the flyout menu. The certificate now appears under the Issued Certificates icon.
Configure a CA to Archive Certificates
The Key Recovery Agent is now prepared. The next stage is to configure the CA to archive certificates. Follow the steps in Procedure 18.4.
Procedure 18.4 Configuring a CA to Archive Certificates
In the Certification Authority console, right-click the server icon and select PROPERTIES from the flyout menu.
Select the Recovery Agents tab in the Properties window (see Figure 18.24).
Figure 18.24. CA Properties window showing Recovery Agents tab.
Select the Archive The Key radio button.
Under the Key Recovery Agents field, click Add. The Key Recovery Agent Selection window opens, listing the account to whom you just issued a Key Recovery Agent certificate.
Click OK to load the agent into the list. The agent icon has a red X in it and the Status shows as Not Loaded.
Click OK to initialize key recovery. You'll be prompted to stop and restart the CA service. Do so.
When the service restarts, verify that the agent status shows Valid.
Create Archive Template
The CA is now ready to archive keys. The next stage is to create a template that can be used to issue archival keys and to load this template into the CA. Follow the steps in Procedure 18.5.
Procedure 18.5 Creating an Archive Template
In the Certification Authority console, load the Certificate Templates snap-in by right-clicking the Certificate Template icon and selecting MANAGE from the flyout menu.
Select the User template icon. At this point, the icon is dimmed.
Right-click the icon and select DUPLICATE TEMPLATE from the flyout menu. A Properties window opens for a copy of the Recovery Agent template (see Figure 18.25).
Figure 18.25. Properties window for copy of User template showing General tab.
Change the Template Display Name to Archive User. The Template Name will change automatically.
Select the Publish Certificate In Active Directory option.
Select the Request Handling tab (see Figure 18.26).
Figure 18.26. Properties window for copy of User template showing Request Handling tab.
Select the Archive Subject's Encryption Private Key option.
Select the Allow Private Key to be Exported option.
Select the Issuance Requirements tab.
De-select the CA Certificate Manager Approval option. This permits the CA to issue the certificate without the intervention of an administrator.
Click OK to initialize the new template. The icon appears in the Templates console in full color.
Close the Templates snap-in.
In the Certification Authority console, press F5 to refresh.
Right-click Certificate Templates and select NEW | CERTIFICATE TEMPLATE TO ISSUE from the flyout menu. The Enable Certificate Templates window opens.
Select the Archive User icon and click OK. The icon now appears in the list of available certificates.
To make sure you can tell the difference between standard certificates and archived certificates, enable the Archived Key column in the console by highlighting the Issued Certificates icon then selecting VIEW | ADD/REMOVE COLUMNS | ARCHIVED KEY from the main console menu.
At this point, you can request an Archive User certificate using the Certificates snap-in at a client desktop. Use the procedure in the section, "Certificate Enrollment Using the Certificates Snap-In."
Recover an Archived Certificate
If a user loses a private encryption key, recover the key from the CA using the steps in Procedure 18.6.
Procedure 18.6 Recovering a Lost Key
Open the Certification Authority console.
Under the Issued Certificates icon, locate the certificate for the key you want to re-issue. There should be a Yes in the Archive Key column, indicating that the certificate is recoverable.
Double-click the certificate icon to open the Properties window.
Select the Details tab and write down the serial number of the certificate (see Figure 18.27) or take a screen shot by using Alt+PrintScrn and then pasting into Mspaint and printing. There are 20 numerals in the serial number. Don't use spaces.
Figure 18.27. Properties window for a certificate showing the Details tab that lists the serial number of the certificate.
From a command prompt, use the CERTUTIL utility to extract the key to an output file, called a blob file, as follows:
certutil -getkey <serial_number> <blob_file>
This blob file contains the private key in PKCS #7 format. You must now convert this file to a PFX file (any name with a .pfx extension) so you can transport it to the user's desktop. Do this with the CERTUTIL utility as follows:
certutil -recoverkey -f <blob_file> <pfx_file>
When prompted for a password, assign a strong password to the file. You will need this password when importing the key at the user's desktop.
Transport the PFX file to the user's desktop then log on as the user and double-click the file in Explorer. This launches the Certificate Import Wizard.
Use the Wizard to place the key in the user's personal store. Verify using the Certificates snap-in that the key is in place.
This completes the recovery procedure.