2.6. Adding a certificate to a user entry in the IdM CLI
You can add an external certificate to a user entry in IdM CLI.
Instead of uploading the whole certificate, it is also possible to upload certificate mapping data to a user entry in IdM. User entries containing either full certificates or certificate mapping data can be used in conjunction with corresponding certificate mapping rules to facilitate the configuration of smart card authentication for system administrators. For details, see Certificate mapping rules for configuring authentication.
If the user’s certificate has been issued by the IdM Certificate Authority, the certificate is already stored in the user entry, and you do not need to follow this procedure.
Prerequisites
- You have the certificate that you want to add to the user entry at your disposal.
Procedure
Log into the IdM CLI as an administrator if you want to add a certificate to another user:
[user@client SmartCard]$ kinit adminFor adding a certificate to your own profile, you do not need the administrator’s credentials.
[user@client SmartCard]$ kinit <smartcard_user>Create an environment variable containing the certificate with the header and footer removed and concatenated into a single line, which is the format expected by the
ipa user-add-certcommand:[user@client SmartCard]$ export CERT=`openssl x509 -outform der -in testuser.crt | base64 -w0 -`Note that certificate in the
testuser.crtfile must be in thePEMformat.Add the certificate to the profile of <smartcard_user> using the
ipa user-add-certcommand:[user@client SmartCard]$ ipa user-add-cert <smartcard_user> --certificate=$CERTThe
<smartcard_user>entry now contains an external certificate.