keyreq |
|
RSA Key Requester Tool v3.0.301.001
|
Keyreq generates a RSA key in a current user CSP store, computes a certificate request for the key, submit it to a Windows 2003 Certificate Server (CA), manage the response (immediate or asynchronous), and optionally
(1) exports the resulting key and certificate to a key-file, (.pfx) and
(2) creates a certificate chain file (.p7b), and
(3) creates the associated ZoneCentral personal acces file (.zaf), and
(4) finally deletes the key and the certificate from the CSP store.
Through their CSP provider, keys can be generated by and inside smart-cards and tokens, and certificates can then be also stored in the card/token.
- The RSA key size and attributes (exchange/signature), and the CSP store can be configured.
- The CA used to deliver the certificate can be found automatically or configured. The certificate model to use can also be configured.
- The Distinguished Name for the target key owner can be configured or found automatically from a Windows account name.
- The names of the output files are deduced from the given user name. The output directory for these files can be configured.
- The password for the key-file, if any, must be configured.
- If the CA delivers certificates automatically, a single command is enough to complete the whole process. If the CA requests an approval from some enrollment agent, the first command will produce a requestId, which will have to be reused later on (when the certificate will have been delivered) with the same command, to terminate the procedure.
Keyreq can be used by a Security Administrator to pre-generate keys, certificates, and personal access lists for users. The key-files (.pfx) and the access list can then be given to users, or pre-installed on computers, or put in a network share. The certificate-files (.p7b) can also be used later to build group access files for ZoneCentral. If correctly configured, the Certificate Server may have automatically published the certificates in ActiveDirectory (in the users accounts), and the certificates are then also available through LDAP requests.
Being a command-line tool, keyreq can be scripted for any number of users, given their domain names and the passwords for their future key-files.
Keyreq works only on a Windows XP+ workstation, and with a Windows Certificate Authority (Windows 2003+). It does not work on 2000 workstations, but may work with a 2000 server. On the local workstation, the Windows components "CERTCLI.DLL" and "XENROLL.DLL" must be available.
THERE IS NO USE OF PRIM'X OR ZONECENTRAL CRYPTOGRAPHY,
except for the 'personal access list' generation, extracted from ZoneCentral.
This is only a simple tool and everything else, including the private key generation and the PFX generation is accomplished with the standard Windows cryptographic APIs.
This tool is provided 'as is' without any warranty.
The key-generation process is made by the targeted/used CSP.
| keyreq | [-dn distinguishedName] [-user userAccountName] [-pwd accountPassword] [-dir outputDir] [-ca certificateAuthority] [-id previousRequestId] [-tpl certificateTemplate] [-zaf] [-nopfx] [-pfxpwd passwordForPFX] [-noP7] [-csp CSPToUse] [-ats] [-ptc] [-size keySize] [-keep] |
| Argument | Description |
|
-dn <DN> |
Distinguished name, in X500 format, of the owner of the key and certificate (subject). |
|
-user <name> |
Windows account name of the user owner of the key and certificate. This value MUST include the domain name, in any format (DOMAIN\User, user@domain, etc.). |
|
-pwd <password> |
Password associated to the username account (-user). Generally not necessary. May be given only if the current Windows user is not himself a member of the domain : the couple username/password will then be used as a credential to gain access to the certificate Server. |
|
-dir <output dir> |
Target directory for the generated files, if any. May be relative to the current directory. |
|
-ca <CA> |
Certificate Server and Authority who must deliver the certificate, in the form COMPUTERNAME\CANAME. |
|
-id <requestId> |
If 'automatic delivery' is enabled in the Certificate Server, this parameter is not used. |
|
-tpl <template> |
Certificate template to use for te requested certificate. Must be given with its 'native english' name. |
|
-zaf |
The command must generate a ZoneCentral 'personal access list' for the target user. |
|
-nopfx |
The command must not generate a key file (.pfx). The RSA key will then remain in the CSP store where it has been generated. If this store is a simple logical store (like Windows' default), you should absolutely also use the -keep parameter, otherwise the key will be deleted (what's the use of a certificate without the corresponding private key ?). |
|
-pfxpwd <password> |
Password to use for the generated key-file (.pfx). |
|
-noP7 |
By default, the command also generates a .p7b file, which is a standard file containing the issued certificate and its complete certification path (hierarchy). This file does not contain the key. |
|
-size <key size> |
Size of the RSA key. Values are 512, 1024 (default) and 2048 bits. |
|
-csp <CSP> |
CSP <store> to use. Supply the entire and exact full name of the CSP. |
|
-ats |
Give the 'AT_SIGNATURE' attribute to the generated RSA-key. |
|
-ptc |
Activates the 'user protection' option for the generated key-pair. |
|
-keep |
Do not delete the RSA key from the CSP at the end of the command. |
For a smart card, use the following syntax : 'nopfx' is used because the target key-store is a smart-card or USB token and not a file, and then 'keep' is also used to leave keys and certificates inside this container :
keyreq -csp "csp name to use" -nopfx -keep
Only certificate templates published in the Certificate Authority can be used. The command 'certutil -template' on the server shows all the available templates, but they may not be published. Go to the Certificate Authority, select your authority, right click 'manage templates' to modify templates. Then go back to the Certificate Authority and check if this template is published. If not, do it.
Beware of the slightest differences between packages and versions of the server. A basic Windows 2003 Server, for instance, does NOT allow you to customize certificate templates, you can only use existing templates.
Certificate templates can enforce the CSP to use, or reduce the choice. Others may never use the DN supplied in the request, replacing it with information extracted from the ActiveDirectory users database. Other templates may enforce RSA key sizes. In those cases, the parameters supplied to keyreq may not give the expective results, even if the command is processed successfully. You must carefully study the certificate template you intend to use, make a trial on a few keys and certificates before going further.
For the processing of a massive amount of user accounts, il may be easier to turn on 'automatic delivery' on the Certificate Server (just during your work). To do so, go to the Certificate Authority, select your authority, display its properties, click on the 'advanced' button on the 'Strategies' tab, and turn on automatic delivery. Restart the CA. Warning: the certificate template may not accept this behaviour (it is generally the case when it allows any DN in the certificate request, because the CA cannot check the identity of the requester).
Keyreq cannot be used to renew certificates.
Keyreq cannot be used with existing RSA keys (in a PFX or in a CSP store).
If you need these features, issue a feature request to Prim'X labs.
[keyreq] is a tool provided freely by Prim'X Technologies to help integration and deployment of Prim'X solutions.
[keyreq ] is delivered 'as is', without any warranty.
[keyreq] is supported by Prim'X Technologies. You may issue support requests, bug reports, or feature requests.