NOTA BENE - ROZPRACOVÁNO - Vaše příspěvky a úvahy
Pro Technologii Báze znalostí - Pro Technologii Báze znalostí - přehled
česky | english
1. Technologická báze znalostí - Klientské Certifikáty - časté dotazy
- Klientské certifikáty pro bezpečné přihléšení (identifikaci) a zašifrování (soukromí).
Contents
- 1. Technologická báze znalostí - Klientské Certifikáty - časté dotazy
- 2. Přehled
- 3. CAcert
- 4. Aplikace
- 5. Modifying software to use client certificates
-
6. FAQ and Misc - Client Cert Troubleshooting
- My IE is showing error code number "-2146885628" (or similar)
- "Where is my private key? How do I use it on another computer?"
- Renew Client Certs under FF
- Were is the PKCS12 file? - I only have the PEM file that says its for smartcard only
- "Windows does not have enough information to verify this certificate"
- My cert is in the browser but not my email client - what now?
- How to enable Client Cert authentication in your Web-Applications
- I want to use Class3 Cert under older Windows System
- iOS won't let me select CAcert client certificates for e-mail signing / encryption
- 7. How can I use Client Certificates like SSH?
- 8. Further References
- 9. Inputs & Thoughts
2. Přehled
Šifrování
- Většina e-mailů a okamžitých zpráv je nezašifrovaná, takže se podobají pohlednicím. To znamená, že lidé s přístupem k síti si je mohou přečíst. To často zahrnuje i přístup k bezdrátovým sítím, které používáte, zaměstnance Vašeho poskytovatele služeb Internetu (ISP), ty, kteří provozují Vámi používané služby, vládní úřady a další.
- Vaše klientské certifikáty CAcert Vám mohou zařídit bezpečnější používání Internetu tím, že Vám umožní vytvářet e-maily a okamžité zprávy, které jsou během celého přenosu zašifrovány, a také tím, že vám umožní přihlásit se na webové stránky bezpečnějším způsobem, než je použití hesla.
Identifikace (Authentication)
- Klientské certifikáty lze také použít k identifikaci (přihlášení, log in) uživatele k webu. Ve srovnání s obvyklým přihlášením heslem to má své výhody:
Ochrana před prolomením: certifikáty X.509 je mnohem těžší prolomit než typická hesla.
Ochrana před nepřátelským operátorem systému (SysOp): Ačkoli obvykle musíte zadat přístupové heslo k úložišti certifikátů svého prohlížeče, toto heslo se nikdy neposílá po síti, přímé ani zašifrované! Proto se jako uživatel webu nemusíte starat o nepřátelské operátory, kteří by si mohli Vaše heslo uložit nezašifrované.
Ochrana před spamery: Jako majitel webu, který přijímá pouze certifikáty vydané CAcert, které obsahují skutečné jméno, nemusíte mít obavy z velkého množství účtů vytvářených spamery. CAcert zajišťuje, že takové certifikáty jsou vydány pouze skutečným osobám, které mají pro vložené jméno oficiální doklady totožnosti.
- Můžete také podepisovat zprávy a elektronické dokumenty.
3. CAcert
Systémy s klientskými certifikáty
- U CAcert jsou nyní klientskými certifikáty (v tabulce: CC) podporovány tyto systémy:
URL
Název systému
typ použití
poznámky
software
hlavní on-line systém pro uživatele CAcert
Pouze CC
Přihlášení klientským certifikátem. Klik na Přihlášení certifikátem. "Normální" přihlášení heslem bez klientského certifikátu je možné jen na www.cacert.org.
CAcert
CAcert blog
CC pro zápis, čtení je volně přístupné
Používá klientské certifikáty pro přidávání poznámek, psaní příspěvků atd. Klik na Přihlášení. Zařídí bez spamu.
CATS - CAcert Automated Testing Service
Pouze CC
Náš pověstný test Výzva zaručovatele. Když test úspěšně dokončíte, CATS oznámí CAcertu pořadové číslo Vašeho certifikátu a Váš účet obdrží značku PASS.
CATS od CAcert
Seznamy adresátů (Maillists)
CC a heslo
Pro nastavení Vaší účasti v seznamech.
sympa.org
Přihlášení certifikátem SympaHlasovací systém
CC je nutný pro hlasování, čtení je volně přístupné
Výbor používá tento systém k zápisu svých návrhů a výsledků hlasování.
Na zakázku
- Všechny výše uvedené systémy provozuje přímo CAcert. Přidejte systémy provozované zaručovateli:
URL
Název systému
typ použití
poznámky
software
Jak od CAcert získáte svůj klientský certifikát
- Než Vám budou uvedené weby fungovat, musíte si vytvořit klientský certifikát a importovat ho do svého webového prohlížeče.
Přihlaste se k webu CAcert na Přihlášení heslem (nebo Přihlášení certifikátem, když už klientský certifikát máte) a zvolte "Klientské certifikáty -> Nový".
- Vyberte svoji výchozí (hlavní) e-mailovou adresu a stiskněte "Další".
- "Úroveň bezpečnosti: vysoká" (2048 bitů) nevadí, jen stiskněte "Vytvořit certifikát".
- Chvíli počkejte a klikněte na odkaz pro import certifikátu (prohlížeče ho zpracovávají různě, so click around).
- Vyzkoušejte ho přechodem na výše uvedené servery.
- Nezapomeňte si vytvořit bezpečnou zálohu svého nového certifikátu (včetně privátního klíče).
Jak získat více e-mailových adres pro svůj klientský certifikát CAcert
- Přihlaste se k webu CAcert (viz předchozí sekce - přihlášení heslem nebo certifikátem)
- Zvolte E-mailové účty - Zobrazit
- Jsou zde definovány všechny e-mailové adresy, které chcete přidat ke svému klientskému certifikátu?
- Pokud ne, přidejte ke svému účtu CAcert pomocí "E-mailové účty - Přidat" tolik e-mailových adres, kolik chcete později přidat ke svému klientskému certifikátu CAcert.
- Ověřte přidané e-mailové adresy. Ke klientskému certifikátu mohou být přidány jen ověřené e-mailové adresy.
Jak získat klientský certifikát CAcert někoho jiného
- Pro použití zabezpečeného e-mailu vyžaduje S/MIME, abyste získal(a) certifikát každé osoby jednotlivě. Typicky požádáte tu osobu, aby Vám poslala digitálně podepsaný e-mail. Její certifikát uložený v podepsané zprávě bude pochopitelně obsahovat POUZE VEŘEJNÝ klíč. Nenuťte ji, aby Vám předala nějaký svůj záložní soubor se svým privátním klíčem.
Další informace viz Servery klíčů klientských certifikátů.
4. Aplikace
- Svoje klientské certifikáty použijete v mnoha aplikacích k mnoha účelům. Zde jsou některé příklady:
E-mailové klienty
Osobní e-mailové certifikáty - jak je konfigurovat a jak je používat.
Webový prohlížeč
Můžete se přihlásit na kterýkoli web OpenID s identifikací svým klientským SSL certifikátem CAcert a používat jakýkoli OpenID software nebo službu, která podporuje SSL Certifikáty, například certifi.ca. Viz OpenID, kde najdete více o vyvíjejícím se přístupu CAcertu k němu.
Klientský certifikát můžete použít i ve svém webovém prohlížeči k přímé identifikaci při přihlášení k některým webům. CATS Výzva zaručovatele je jedním z nich; tento web vyžaduje, abyste měli klientský certifikát CAcert. Viz výše, kde je jich uvedeno více.
Zrady
- Použití klientských certifikátů k přihlašování je (technicky) bezpečnější, než použití hesel, ale jsou tu nějaké nečekané zrady:
- Certifikát vyprší každé 2 roky (platí pro zaručené členy), takže pak musíte být schopni se přihlásit k CAcert a získat nový (obnovit ho).
Certifikáty (přesněji: privátní klíče uložené ve Vašem prohlížeči) by měly mít zálohu. Zvláště pak, představují-li jediný způsob, jak získat přístup k některým webům; a ten přístup ztratíte, dojde-li k poškození hardwaru nebo softwaru Vašeho počítače.
Prohlížeče jako Firefox zacházejí s více certifikáty obzvlášť špatně. Měl(a) byste raději mít jeden a pouze jeden certifikát, protože ten prohlížeč v současném stavu skutečně nemůže poskytnout vyhovující rozhraní, abyste spárovali navštěvované weby se správným certifikátem.
- Použití certifikátů znamená, že předkládáte navštěvovanému webu životaschopnou a ověřenou identitu; znamená to, že web může poznat, kdo jste a tu informaci si uložit. To představuje určitý vliv na soukromí.
- Weby nemají často jasno v tom, jak implementovat klientské certifikáty. Je pravda, že to není snadné, protože v jejich podkladové architektuře (například operačních systémech) bývají chyby. Některé weby trvají pouze na klientských certifikátech a dají Vás na divné místo, když je nemáte. Jiné weby zkoušejí směšovat použití klientských a ne-klientských certifikátů a otevírají tak dveře zmatku a závadám bezpečnosti. V současnosti neexistuje jediné správné řešení.
- Ze všech těchto důvodů byste si měl(a) heslo pro CAcert napsat a uschovat na bezpečném místě.
Okamžité zprávy (Instant Messaging, IM)
- Většina běžných klientů Instant Messaging pro Jabber, MSN, AIM, ICQ, atd. standardně Vaše zprávy nešifruje. Ale někdy je můžete zašifrovat Vy.
- Příklady
- S/MIME (CAcert certifikát) - plánován pro Jabber; předpokládá se spolupráce s AIM
- GPG/PGP - psí [asi řecké písmeno] Jabber klient; kopete
OTR - Pidgin (původně známý jako Gaim); adium; Jabber Proxies
Poznámka: proskočily zprávy, že AOL uplatňoval právo použít Vaše zprávy AIM k libovolným účelům, ale prý to bylo nedorozumění: http://www.snopes.com/computer/internet/aim.asp
OpenSSH
- Using your CAcert client certificate to login via SSH (on Linux):
- generate a client certificate
- export it as PKCS12 file ( e.g. to /home/user/MyCert.P12 )
- convert it to PEM ( run openssl pkcs12 -in /home/user/MyCert.P12 -out /home/user/.ssh/id_rsa )
- secure the PEM-file ( chmod 600 /home/user/.ssh/id_rsa )
- create a ssh-usable public key ( run ssh-keygen -y )
- insert the output ( ssh-rsa .... ) to .ssh/authorized_keys2 on every server you wish to use this key
Encryption Applications
Note: CAcert does not provide support for the following products; we only issue the certs!
Open-source multi-platform package: Cryptonit
Signing Documents
OpenOffice up from version 2.0 is able to sign documents. Please read the wiki for OpenOffice.
- PDF-Signer to be added!
SVN
See Jan's SVN Client Cert Guide, which is a small step by step guide on how to setup client certificates with:
- OpenSSL, GNUTLS or Firefox for certificate creation
- Subversion command line client, TortoiseSVN or Eclipse as clients
Also note, local sysadm notes, and there should be some notes on the BirdShack wiki (when it comes back online).
OpenSSL
5. Modifying software to use client certificates
Essentially, it isn't easy to use client-certs unless the software at the server side actually takes them and uses them. This means that we need to get a lot of these servers up and running, and document the methods so others can follow. This section is an index into known experiences here. You can help: set your system up to use client-certs, and document how it went!
OpenID
If your web application or web site supports OpenID, people can choose to use an OpenID server that supports the use of their CAcert client certificates when using your web application or web site. See OpenID for providers and info.
Apache
- See
the Apache Tutorial by DanielBlack on how to set up Apache with client certs.
the dotProject for an alternate view by MarkusWarg
phpBB (ver 3) discussion forum
- You can let your discussion forum users to log in using certificates. Addition to the original code is simple (please ask the phpBB community to make this a default feature) Add following code to your authority plugin (by default includes/auth/auth_db.php)
function autologin_db() { global $db, $config; if ($_SERVER[SSL_CLIENT_VERIFY] == "SUCCESS") { $sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_email = '" . $db->sql_escape($_SERVER[SSL_CLIENT_S_DN_Email]) . "'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); if ($row) { return $row; } } return array(); }
Enable Client Certs for .project
If you are interested in seeing how to make the Open Source Project Management tool .project (http://www.dotproject.net) client cert aware, please have a look at Technology Knowledge Base dotProject.
6. FAQ and Misc - Client Cert Troubleshooting
My IE is showing error code number "-2146885628" (or similar)
- Nearly all error messages related to certificate installs are the result of people not having a matching private key, or for the cert logins, not being able to match a key/certificate valid for the CAs acceptable.
Basically people have reinstalled things on their computer, or are using a different browser and don't realize that we don't keep copies of private keys they can then later download along with the certificate from our website.
"Where is my private key? How do I use it on another computer?"
- Your private key is generated by your browser, *IN* your browser when you request a new cert from CAcert. That way CAcert never has your private key in its possession. The implication for you is that you must be on the same machine using the same browser that you used to request the cert initially, when needing to access your private key. So don't forget if it was your "work" machine vs. your "home" machine.
- Your keys are contained in something called the key "store". You may export public/private keypairs from your store to a file, and optionally (but highly recommended!) secure them with a passphrase. This is typically done by going into the "Manage Certificates" section of your browser (i.e., Firefox), and then performing a "Backup" of your key. This will create a file with with a .P12 or .PFX suffix.
- You may then go into another application which uses client certificates (e.g., Thunderbird, IM, etc.,), and use "Manage Certificates" to "Import" the .P12 file previously created. After providing the correct passphrase, your public/private keypairs will now be available in the new application.
it is very interesting to generate a keypair and your CAcert cert on a smartcard. That's wise and a good way to protect your keys. But don't forget, you'll never be able to export the private key see CryptoHardware
Renew Client Certs under FF
Today I had to renew my active client cert cc9f, so I did what to do
- Going to the www.cacert.org website
Client Cert login with my still valid client cert cc9f
Menu Client Certs - Renew
Selecting the cc9f and clicking the button Renew
- So far so good, the website still worked and website presented me a "IE5 installation" button and a block of cert code in full ascii
Clicking the IE5 installation button doesn't work, copy and paste the ascii code cert into an ascii text file, name it signedKeyfile.crt (later named -> new-pub-signed-11e7e.cer) and trying an import into the FF keystore doesn't work
The downloaded signed key doesn't include the private key!!!
- and Firefox didn't let me import the signed key easily
Required steps to get your renewed key working: (for better reference I name the "old" key cc9f and the new key 11e7e, also a reference if its the private or public key)
export the private key from the "old", still existing and still valid, unrevoked client cert cc9f in the FF keystore
save as pkcs12 -> step1-export-priv-pub-key-cc9f.p12
- Convert with openssl a PKCS#12 file (.pfx .p12) containing a private key and certificates to PEM
- You can add -nocerts to only output the private key or add -nokeys to only output the certificates.
openssl pkcs12 -in step1-export-priv-pub-key-cc9f.p12 -out step2-convert-priv-pub-to-priv-key-cc9f.pem -nodes -nocerts
The result is the file step2-convert-priv-pub-to-priv-key-cc9f.pem that includes only the private key part from the old certificate cc9f that we have to marriage in next step with the new (renewed) signed public key
- You can add -nocerts to only output the private key or add -nokeys to only output the certificates.
- Merge priv + pub to new pfx key
openssl pkcs12 -export -out my-11e7e-Priv-Pub.pfx -inkey step2-convert-priv-pub-to-priv-key-cc9f.pem -in new-pub-signed-11e7e.cer -name "key11e7e"
The resulting output file is my-11e7e-Priv-Pub.pfx that includes the private keypart from previous priv/public key cc9f and the public key(part) of the renewed, signed key with new serial number (here 11e7e)
The new "merged" private + public key my-11e7e-Priv-Pub.pfx you now can use for import back into your browser, email clients and other programs
Helpful link with useful description and several openssl commands listed: How to Convert certificates between PEM, DER, P7B/PKCS#7, PFX/PKCS#12
Were is the PKCS12 file? - I only have the PEM file that says its for smartcard only
openssl pkcs12 -export -in cert.pem -inkey private.key -certfile /etc/ssl/certs/root.pem -name "Bob's CAcert" -out cert.p12
"Windows does not have enough information to verify this certificate"
- [Q] I am using win2000 and outlook from office 2000. I installed my certificate using IE and went to outlook - options - security - settings to choose the cert that I installed. The trouble I'm having is that when I try to send a signed and encrypted E-mail, I get an error that the cert is not valid. When viewing the cert in outlook, it states that "windows does not have enough information to verify this certificate"
[A] It sounds like you might be missing the CAcert Root certificate and/or you have it, but have not "trusted" it yet. You can pick up a copy at: https://www.cacert.org/index.php?id=3
- Once it is installed, check to see if it is trusted. That will hopefully solve the error you're getting with your personal cert.
- [A] Each email address that you are sending too in outlook needs to have a public certificate assoicated with it. To get that certificate for the person you are trying to send an encrypted message to have them send a signed email to you.
- When you recieve that email right click on the senders address (not the email itself). Select add to contacts. This will install the public certificate for you to use when sending emails. You can see that certificate by selecting the certificates tab on the top of your contact information.
- If this person is already in your contact list then do the following:
- Right click the senders address (not the email itself). Select add to contacts. Select the certificates tab. highlight the certificate and select export. Change the name to something you will recognize and select a location you will remember, enter a password and save. Close the new contact and do not save the changes (this removes the duplicate contact). Right click the senders address (by now you should recoginize the pattern) select lookup contact. select the certificates tab and import the certificate using the path, name and password you just entered. You should be able to send encrypted messages to that address now.
My cert is in the browser but not my email client - what now?
- [Q] I tried to install my e-mail cert into Mozilla Thunderbird (the latest as of today) and somehow could not sign a message. Thunderbird tells me that I first have to set up my certificates (hey - I did that! and I verified that the cert is there, including the CA root) and if I want to learn how to do that - sure I say yes - the dialog goes away and nothing happens.
[A] You need to export the certificate and private key from your browser; just importing the certificate is only half the information needed to encrypt/sign emails. CAcert never gets (or even wants) a copy of your private key. (See topic 3.1 for more details)
How to enable Client Cert authentication in your Web-Applications
There is another PHP example including details on Apache configuration.
- Unfortunately client authentication does not seem to work when SSLCACertificatePath option in Apache2 is used. This seems to be default configuration for example in Ubuntu. To fix it:
- change
- SSLCACertificatePath /etc/ssl/certs/
- to
- SSLCACertificateFile /etc/ssl/certs/ca-certificates.crt
- in your apache configuration files and it works again..
If you need a CA-Bundle for your webserver, you can get one, which has CAcert included here: http://www2.futureware.at/svn/sourcerer/CAcert/ca-bundle.zip
Unanswered question: How do I simply add CAcert to my existing ca-bundle? Answer: Get the CAcert root certificates (both Class1 and Class3), open them in a Text-Editor, and copy&paste them into the ca-bundle, for example at the end of the file.
For the following example, you have to set SSLVerify to "optional" or "required" in your Apache configuration. "required" forces the browser to show a certificate, and does not give access to the Vhost (or directory), unless the client presents a valid certificate. "optional" accepts certificates optionally, so the client can also access the vhost without a certificate. When you set SSLOptions to +CompatEnvVars +StdEnvVars then mod_ssl will put all interesting details into the environment variables, which are easily accessible from any programming language:
$ca=""; if($ENV{'SSL_CLIENT_VERIFY'} and $ENV{'SSL_CLIENT_VERIFY'} eq "SUCCESS") { if($ENV{SSL_CLIENT_I_DN_OU} eq "http://www.cacert.org") { $ca="CAcert"; } if($ca and $ENV{SSL_CLIENT_S_DN_Email}) { $auth="email+clientzert"; $authuser=$ENV{SSL_CLIENT_S_DN_CN}; $authemail=$ENV{SSL_CLIENT_S_DN_Email}; print "Welcome $ENV{SSL_CLIENT_S_DN_CN} (<a href=\"mailto:$ENV{SSL_CLIENT_S_DN_Email}\">)!<br/>"; }
I want to use Class3 Cert under older Windows System
If you experiences problems using the new Class3 Subroot and creating class3 client certificates, probably your older Windows system (Windows XP, Windows 2003) does not have the patch Microsoft Base Smart Card Crypto Provider (KB909520) installed.
- KB909520 installs support for sha256 and other crypto providers like AES128, AES192, AES256 and more
Further infos about crypto providers under Windows read MSDN library article CryptoAPI Cryptographic Service Providers
iOS won't let me select CAcert client certificates for e-mail signing / encryption
I was unable to select client certificates signed by CAcert for S/MIME signing and encrypting of e-mails. Multiple certificates (generated using IE 10.0.10 and Opera Next 17.0; including or excluding name; class 1 or class 3) had been created and installed by various means including the iPhone Configuration Utility method. This method is similar to the method described here, which didn't work for me as the configuration utility did not let me choose any certificates in steps 30 and 31.
- In a new approach, I used Firefox 24.0 to generate the certificate and exported a .p12-file from its certificate manager. After transfering this file to my iPhone, I was able to install the certificate and utilize it to sign and encrypt e-mails
7. How can I use Client Certificates like SSH?
- For your Apache configuration:
SSLOptions +ExportCertData +CompatEnvVars +StdEnvVars SSLVerify optional_no_ca
- The application:
$ca=""; if($ENV{'SSL_CLIENT_VERIFY'} and $ENV{'SSL_CLIENT_VERIFY'} eq "SUCCESS") { echo $ENV{SSL_CLIENT_KEY}; }
8. Further References
the Apache Tutorial by DanielBlack on how to set up Apache with client certs.
the dotProject for an alternate view by MarkusWarg
Iang's Lightning Talk on Client Certificates and SSO - the Old-New Thing for Fosdem 2010.
Slides at ODP source and PDF output.
youTube video of talk.
the Eccentric Project by Guido Witmond uses client-certs in a website-as-own-CA configuration to authenticate all members to all other members on a psuedonymous basis.
9. Inputs & Thoughts
YYYYMMDD-YourName
Text / Your Statements, thoughts and e-mail snippets, Please
YYYYMMDD-YourName
Text / Your Statements, thoughts and e-mail snippets, Please