1\input texinfo @c -*- texinfo -*- 2@c $NetBSD: hx509.texi,v 1.1.1.2 2011/04/14 14:08:08 elric Exp $ 3@c %**start of header 4@c Id 5@setfilename hx509.info 6@settitle HX509 7@iftex 8@afourpaper 9@end iftex 10@c some sensible characters, please? 11@tex 12\input latin1.tex 13@end tex 14@setchapternewpage on 15@syncodeindex pg cp 16@c %**end of header 17 18@include vars.texi 19 20@set VERSION @value{PACKAGE_VERSION} 21@set EDITION 1.0 22 23@ifinfo 24@dircategory Security 25@direntry 26* hx509: (hx509). The X.509 distribution from KTH 27@end direntry 28@end ifinfo 29 30@c title page 31@titlepage 32@title HX509 33@subtitle X.509 distribution from KTH 34@subtitle Edition @value{EDITION}, for version @value{VERSION} 35@subtitle 2008 36@author Love Hörnquist Åstrand 37 38@def@copynext{@vskip 20pt plus 1fil} 39@def@copyrightstart{} 40@def@copyrightend{} 41@page 42@copyrightstart 43Copyright (c) 1994-2008 Kungliga Tekniska Högskolan 44(Royal Institute of Technology, Stockholm, Sweden). 45All rights reserved. 46 47Redistribution and use in source and binary forms, with or without 48modification, are permitted provided that the following conditions 49are met: 50 511. Redistributions of source code must retain the above copyright 52 notice, this list of conditions and the following disclaimer. 53 542. Redistributions in binary form must reproduce the above copyright 55 notice, this list of conditions and the following disclaimer in the 56 documentation and/or other materials provided with the distribution. 57 583. Neither the name of the Institute nor the names of its contributors 59 may be used to endorse or promote products derived from this software 60 without specific prior written permission. 61 62THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 63ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 64IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 65ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 66FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 67DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 68OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 69HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 70LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 71OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 72SUCH DAMAGE. 73 74@copynext 75 76Copyright (c) 1988, 1990, 1993 77 The Regents of the University of California. All rights reserved. 78 79Redistribution and use in source and binary forms, with or without 80modification, are permitted provided that the following conditions 81are met: 82 831. Redistributions of source code must retain the above copyright 84 notice, this list of conditions and the following disclaimer. 85 862. Redistributions in binary form must reproduce the above copyright 87 notice, this list of conditions and the following disclaimer in the 88 documentation and/or other materials provided with the distribution. 89 903. Neither the name of the University nor the names of its contributors 91 may be used to endorse or promote products derived from this software 92 without specific prior written permission. 93 94THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 95ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 96IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 97ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 98FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 99DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 100OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 101HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 102LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 103OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 104SUCH DAMAGE. 105 106@copynext 107 108Copyright 1992 Simmule Turner and Rich Salz. All rights reserved. 109 110This software is not subject to any license of the American Telephone 111and Telegraph Company or of the Regents of the University of California. 112 113Permission is granted to anyone to use this software for any purpose on 114any computer system, and to alter it and redistribute it freely, subject 115to the following restrictions: 116 1171. The authors are not responsible for the consequences of use of this 118 software, no matter how awful, even if they arise from flaws in it. 119 1202. The origin of this software must not be misrepresented, either by 121 explicit claim or by omission. Since few users ever read sources, 122 credits must appear in the documentation. 123 1243. Altered versions must be plainly marked as such, and must not be 125 misrepresented as being the original software. Since few users 126 ever read sources, credits must appear in the documentation. 127 1284. This notice may not be removed or altered. 129 130@copynext 131 132IMath is Copyright 2002-2005 Michael J. Fromberger 133You may use it subject to the following Licensing Terms: 134 135Permission is hereby granted, free of charge, to any person obtaining 136a copy of this software and associated documentation files (the 137"Software"), to deal in the Software without restriction, including 138without limitation the rights to use, copy, modify, merge, publish, 139distribute, sublicense, and/or sell copies of the Software, and to 140permit persons to whom the Software is furnished to do so, subject to 141the following conditions: 142 143The above copyright notice and this permission notice shall be 144included in all copies or substantial portions of the Software. 145 146THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 147EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 148MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 149IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 150CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 151TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 152SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 153 154@copyrightend 155@end titlepage 156 157@macro manpage{man, section} 158@cite{\man\(\section\)} 159@end macro 160 161@c Less filling! Tastes great! 162@iftex 163@parindent=0pt 164@global@parskip 6pt plus 1pt 165@global@chapheadingskip = 15pt plus 4pt minus 2pt 166@global@secheadingskip = 12pt plus 3pt minus 2pt 167@global@subsecheadingskip = 9pt plus 2pt minus 2pt 168@end iftex 169@ifinfo 170@paragraphindent 0 171@end ifinfo 172 173@ifnottex 174@node Top, Introduction, (dir), (dir) 175@top Heimdal 176@end ifnottex 177 178This manual is for version @value{VERSION} of hx509. 179 180@menu 181* Introduction:: 182* What is X.509 ?:: 183* Setting up a CA:: 184* CMS signing and encryption:: 185* Certificate matching:: 186* Software PKCS 11 module:: 187 188@detailmenu 189 --- The Detailed Node Listing --- 190 191Setting up a CA 192 193@c * Issuing certificates:: 194* Creating a CA certificate:: 195* Issuing certificates:: 196* Issuing CRLs:: 197@c * Issuing a proxy certificate:: 198@c * Creating a user certificate:: 199@c * Validating a certificate:: 200@c * Validating a certificate path:: 201* Application requirements:: 202 203CMS signing and encryption 204 205* CMS background:: 206 207Certificate matching 208 209* Matching syntax:: 210 211Software PKCS 11 module 212 213* How to use the PKCS11 module:: 214 215@end detailmenu 216@end menu 217 218@node Introduction, What is X.509 ?, Top, Top 219@chapter Introduction 220 221The goals of a PKI infrastructure (as defined in 222<a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280</a>) is to meet 223@emph{the needs of deterministic, automated identification, authentication, access control, and authorization}. 224 225 226The administrator should be aware of certain terminologies as explained by the aforementioned 227RFC before attemping to put in place a PKI infrastructure. Briefly, these are: 228 229@itemize @bullet 230@item CA 231Certificate Authority 232@item RA 233Registration Authority, i.e., an optional system to which a CA delegates certain management functions. 234@item CRL Issuer 235An optional system to which a CA delegates the publication of certificate revocation lists. 236@item Repository 237A system or collection of distributed systems that stores certificates and CRLs 238and serves as a means of distributing these certificates and CRLs to end entities 239@end itemize 240 241hx509 (Heimdal x509 support) is a near complete X.509 stack that can 242handle CMS messages (crypto system used in S/MIME and Kerberos PK-INIT) 243and basic certificate processing tasks, path construction, path 244validation, OCSP and CRL validation, PKCS10 message construction, CMS 245Encrypted (shared secret encrypted), CMS SignedData (certificate 246signed), and CMS EnvelopedData (certificate encrypted). 247 248hx509 can use PKCS11 tokens, PKCS12 files, PEM files, and/or DER encoded 249files. 250 251@node What is X.509 ?, Setting up a CA, Introduction, Top 252@chapter What is X.509, PKIX, PKCS7 and CMS ? 253 254X.509 was created by CCITT (later ITU) for the X.500 directory 255service. Today, X.509 discussions and implementations commonly reference 256the IETF's PKIX Certificate and CRL Profile of the X.509 v3 certificate 257standard, as specified in RFC 3280. 258 259ITU continues to develop the X.509 standard together with the IETF in a 260rather complicated dance. 261 262X.509 is a public key based security system that has associated data 263stored within a so called certificate. Initially, X.509 was a strict 264hierarchical system with one root. However, ever evolving requiments and 265technology advancements saw the inclusion of multiple policy roots, 266bridges and mesh solutions. 267 268x.509 can also be used as a peer to peer system, though often seen as a 269common scenario. 270 271@section Type of certificates 272 273There are several flavors of certificate in X.509. 274 275@itemize @bullet 276 277@item Trust anchors 278 279Trust anchors are strictly not certificates, but commonly stored in a 280certificate format as they become easier to manage. Trust anchors are 281the keys that an end entity would trust to validate other certificates. 282This is done by building a path from the certificate you want to 283validate to to any of the trust anchors you have. 284 285@item End Entity (EE) certificates 286 287End entity certificates are the most common types of certificates. End 288entity certificates cannot issue (sign) certificate themselves and are generally 289used to authenticate and authorize users and services. 290 291@item Certification Authority (CA) certificates 292 293Certificate authority certificates have the right to issue additional 294certificates (be it sub-ordinate CA certificates to build an trust anchors 295or end entity certificates). There is no limit to how many certificates a CA 296may issue, but there might other restrictions, like the maximum path 297depth. 298 299@item Proxy certificates 300 301Remember the statement "End Entity certificates cannot issue 302certificates"? Well that statement is not entirely true. There is an 303extension called proxy certificates defined in RFC3820, that allows 304certificates to be issued by end entity certificates. The service that 305receives the proxy certificates must have explicitly turned on support 306for proxy certificates, so their use is somewhat limited. 307 308Proxy certificates can be limited by policies stored in the certificate to 309what they can be used for. This allows users to delegate the proxy 310certificate to services (by sending over the certificate and private 311key) so the service can access services on behalf of the user. 312 313One example of this would be a print service. The user wants to print a 314large job in the middle of the night when the printer isn't used that 315much, so the user creates a proxy certificate with the policy that it 316can only be used to access files related to this print job, creates the 317print job description and send both the description and proxy 318certificate with key over to print service. Later at night when the 319print service initializes (without any user intervention), access to the files 320for the print job is granted via the proxy certificate. As a result of (in-place) 321policy limitations, the certificate cannot be used for any other purposes. 322 323@end itemize 324 325@section Building a path 326 327Before validating a certificate path (or chain), the path needs to be 328constructed. Given a certificate (EE, CA, Proxy, or any other type), 329the path construction algorithm will try to find a path to one of the 330trust anchors. 331 332The process starts by looking at the issuing CA of the certificate, by 333Name or Key Identifier, and tries to find that certificate while at the 334same time evaluting any policies in-place. 335 336@node Setting up a CA, Creating a CA certificate, What is X.509 ?, Top 337@chapter Setting up a CA 338 339Do not let information overload scare you off! If you are simply testing 340or getting started with a PKI infrastructure, skip all this and go to 341the next chapter (see: @pxref{Creating a CA certificate}). 342 343Creating a CA certificate should be more the just creating a 344certificate, CA's should define a policy. Again, if you are simply 345testing a PKI, policies do not matter so much. However, when it comes to 346trust in an organisation, it will probably matter more whom your users 347and sysadmins will find it acceptable to trust. 348 349At the same time, try to keep things simple, it's not very hard to run a 350Certificate authority and the process to get new certificates should be simple. 351 352You may find it helpful to answer the following policy questions for 353your organization at a later stage: 354 355@itemize @bullet 356@item How do you trust your CA. 357@item What is the CA responsibility. 358@item Review of CA activity. 359@item How much process should it be to issue certificate. 360@item Who is allowed to issue certificates. 361@item Who is allowed to requests certificates. 362@item How to handle certificate revocation, issuing CRLs and maintain OCSP services. 363@end itemize 364 365@node Creating a CA certificate, Issuing certificates, Setting up a CA, Top 366@section Creating a CA certificate 367 368This section describes how to create a CA certificate and what to think 369about. 370 371@subsection Lifetime CA certificate 372 373You probably want to create a CA certificate with a long lifetime, 10 374years at the very minimum. This is because you don't want to push out the 375certificate (as a trust anchor) to all you users again when the old 376CA certificate expires. Although a trust anchor can't really expire, not all 377software works in accordance with published standards. 378 379Keep in mind the security requirements might be different 10-20 years 380into the future. For example, SHA1 is going to be withdrawn in 2010, so 381make sure you have enough buffering in your choice of digest/hash 382algorithms, signature algorithms and key lengths. 383 384@subsection Create a CA certificate 385 386This command below can be used to generate a self-signed CA certificate. 387 388@example 389hxtool issue-certificate \ 390 --self-signed \ 391 --issue-ca \ 392 --generate-key=rsa \ 393 --subject="CN=CertificateAuthority,DC=test,DC=h5l,DC=se" \ 394 --lifetime=10years \ 395 --certificate="FILE:ca.pem" 396@end example 397 398@subsection Extending the lifetime of a CA certificate 399 400You just realised that your CA certificate is going to expire soon and 401that you need replace it with a new CA. The easiest way to do that 402is to extend the lifetime of your existing CA certificate. 403 404The example below will extend the CA certificate's lifetime by 10 years. 405You should compare this new certificate if it contains all the 406special tweaks as the old certificate had. 407 408@example 409hxtool issue-certificate \ 410 --self-signed \ 411 --issue-ca \ 412 --lifetime="10years" \ 413 --template-certificate="FILE:ca.pem" \ 414 --template-fields="serialNumber,notBefore,subject,SPKI" \ 415 --ca-private-key=FILE:ca.pem \ 416 --certificate="FILE:new-ca.pem" 417@end example 418 419@subsection Subordinate CA 420 421This example below creates a new subordinate certificate authority. 422 423@example 424hxtool issue-certificate \ 425 --ca-certificate=FILE:ca.pem \ 426 --issue-ca \ 427 --generate-key=rsa \ 428 --subject="CN=CertificateAuthority,DC=dev,DC=test,DC=h5l,DC=se" \ 429 --certificate="FILE:dev-ca.pem" 430@end example 431 432 433@node Issuing certificates, Issuing CRLs, Creating a CA certificate, Top 434@section Issuing certificates 435 436First you'll create a CA certificate, after that you have to deal with 437your users and servers and issue certificates to them. 438 439@c I think this section needs a bit of clarity. Can I add a separate 440@c section which explains CSRs as well? 441 442 443@itemize @bullet 444 445@item Do all the work themself 446 447Generate the key for the user. This has the problme that the the CA 448knows the private key of the user. For a paranoid user this might leave 449feeling of disconfort. 450 451@item Have the user do part of the work 452 453Receive PKCS10 certificate requests fromusers. PKCS10 is a request for a 454certificate. The user may specify what DN they want as well as provide 455a certificate signing request (CSR). To prove the user have the key, 456the whole request is signed by the private key of the user. 457 458@end itemize 459 460@subsection Name space management 461 462@c The explanation given below is slightly unclear. I will re-read the 463@c RFC and document accordingly 464 465What people might want to see. 466 467Re-issue certificates just because people moved within the organization. 468 469Expose privacy information. 470 471Using Sub-component name (+ notation). 472 473@subsection Certificate Revocation, CRL and OCSP 474 475Certificates that a CA issues may need to be revoked at some stage. As 476an example, an employee leaves the organization and does not bother 477handing in his smart card (or even if the smart card is handed back -- 478the certificate on it must no longer be acceptable to services; the 479employee has left). 480 481You may also want to revoke a certificate for a service which is no 482longer being offered on your network. Overlooking these scenarios can 483lead to security holes which will quickly become a nightmare to deal 484with. 485 486There are two primary protocols for dealing with certificate 487revokation. Namely: 488 489@itemize @bullet 490@item Certificate Revocation List (CRL) 491@item Online Certificate Status Protocol (OCSP) 492@end itemize 493 494If however the certificate in qeustion has been destroyed, there is no 495need to revoke the certificate because it can not be used by someone 496else. This matter since for each certificate you add to CRL, the 497download time and processing time for clients are longer. 498 499CRLs and OCSP responders however greatly help manage compatible services 500which may authenticate and authorize users (or services) on an on-going 501basis. As an example, VPN connectivity established via certificates for 502connecting clients would require your VPN software to make use of a CRL 503or an OCSP service to ensure revoked certificates belonging to former 504clients are not allowed access to (formerly subscribed) network 505services. 506 507 508@node Issuing CRLs, Application requirements, Issuing certificates, Top 509@section Issuing CRLs 510 511Create an empty CRL with no certificates revoked. Default expiration 512value is one year from now. 513 514@example 515hxtool crl-sign \ 516 --crl-file=crl.der \ 517 --signer=FILE:ca.pem 518@end example 519 520Create a CRL with all certificates in the directory 521@file{/path/to/revoked/dir} included in the CRL as revoked. Also make 522it expire one month from now. 523 524@example 525hxtool crl-sign \ 526 --crl-file=crl.der \ 527 --signer=FILE:ca.pem \ 528 --lifetime='1 month' \ 529 DIR:/path/to/revoked/dir 530@end example 531 532@node Application requirements, CMS signing and encryption, Issuing CRLs, Top 533@section Application requirements 534 535Application place different requirements on certificates. This section 536tries to expand what they are and how to use hxtool to generate 537certificates for those services. 538 539@subsection HTTPS - server 540 541@example 542hxtool issue-certificate \ 543 --subject="CN=www.test.h5l.se,DC=test,DC=h5l,DC=se" \ 544 --type="https-server" \ 545 --hostname="www.test.h5l.se" \ 546 --hostname="www2.test.h5l.se" \ 547 ... 548@end example 549 550@subsection HTTPS - client 551 552@example 553hxtool issue-certificate \ 554 --subject="UID=testus,DC=test,DC=h5l,DC=se" \ 555 --type="https-client" \ 556 ... 557@end example 558 559@subsection S/MIME - email 560 561There are two things that should be set in S/MIME certificates, one or 562more email addresses and an extended eku usage (EKU), emailProtection. 563 564The email address format used in S/MIME certificates is defined in 565RFC2822, section 3.4.1 and it should be an ``addr-spec''. 566 567There are two ways to specifify email address in certificates. The old 568way is in the subject distinguished name, @emph{this should not be used}. The 569new way is using a Subject Alternative Name (SAN). 570 571Even though the email address is stored in certificates, they don't need 572to be, email reader programs are required to accept certificates that 573doesn't have either of the two methods of storing email in certificates 574-- in which case, the email client will try to protect the user by 575printing the name of the certificate instead. 576 577S/MIME certificate can be used in another special way. They can be 578issued with a NULL subject distinguished name plus the email in SAN, 579this is a valid certificate. This is used when you wont want to share 580more information then you need to. 581 582hx509 issue-certificate supports adding the email SAN to certificate by 583using the --email option, --email also gives an implicit emailProtection 584eku. If you want to create an certificate without an email address, the 585option --type=email will add the emailProtection EKU. 586 587@example 588hxtool issue-certificate \ 589 --subject="UID=testus-email,DC=test,DC=h5l,DC=se" \ 590 --type=email \ 591 --email="testus@@test.h5l.se" \ 592 ... 593@end example 594 595An example of an certificate without and subject distinguished name with 596an email address in a SAN. 597 598@example 599hxtool issue-certificate \ 600 --subject="" \ 601 --type=email \ 602 --email="testus@@test.h5l.se" \ 603 ... 604@end example 605 606@subsection PK-INIT 607 608A PK-INIT infrastructure allows users and services to pick up kerberos 609credentials (tickets) based on their certificate. This, for example, 610allows users to authenticate to their desktops using smartcards while 611acquiring kerberos tickets in the process. 612 613As an example, an office network which offers centrally controlled 614desktop logins, mail, messaging (xmpp) and openafs would give users 615single sign-on facilities via smartcard based logins. Once the kerberos 616ticket has been acquired, all kerberized services would immediately 617become accessible based on deployed security policies. 618 619Let's go over the process of initializing a demo PK-INIT framework: 620 621@example 622hxtool issue-certificate \ 623 --type="pkinit-kdc" \ 624 --pk-init-principal="krbtgt/TEST.H5L.SE@@TEST.H5L.SE" \ 625 --hostname=kerberos.test.h5l.se \ 626 --ca-certificate="FILE:ca.pem,ca.key" \ 627 --generate-key=rsa \ 628 --certificate="FILE:kdc.pem" \ 629 --subject="cn=kdc" 630@end example 631 632How to create a certificate for a user. 633 634@example 635hxtool issue-certificate \ 636 --type="pkinit-client" \ 637 --pk-init-principal="user@@TEST.H5L.SE" \ 638 --ca-certificate="FILE:ca.pem,ca.key" \ 639 --generate-key=rsa \ 640 --subject="cn=Test User" \ 641 --certificate="FILE:user.pem" 642@end example 643 644The --type field can be specified multiple times. The same certificate 645can hence house extensions for both pkinit-client as well as S/MIME. 646 647To use the PKCS11 module, please see the section: 648@pxref{How to use the PKCS11 module}. 649 650More about how to configure the KDC, see the documentation in the 651Heimdal manual to set up the KDC. 652 653@subsection XMPP/Jabber 654 655The jabber server certificate should have a dNSname that is the same as 656the user entered into the application, not the same as the host name of 657the machine. 658 659@example 660hxtool issue-certificate \ 661 --subject="CN=xmpp1.test.h5l.se,DC=test,DC=h5l,DC=se" \ 662 --hostname="xmpp1.test.h5l.se" \ 663 --hostname="test.h5l.se" \ 664 ... 665@end example 666 667The certificate may also contain a jabber identifier (JID) that, if the 668receiver allows it, authorises the server or client to use that JID. 669 670When storing a JID inside the certificate, both for server and client, 671it's stored inside a UTF8String within an otherName entity inside the 672subjectAltName, using the OID id-on-xmppAddr (1.3.6.1.5.5.7.8.5). 673 674To read more about the requirements, see RFC3920, Extensible Messaging 675and Presence Protocol (XMPP): Core. 676 677hxtool issue-certificate have support to add jid to the certificate 678using the option @kbd{--jid}. 679 680@example 681hxtool issue-certificate \ 682 --subject="CN=Love,DC=test,DC=h5l,DC=se" \ 683 --jid="lha@@test.h5l.se" \ 684 ... 685@end example 686 687 688@node CMS signing and encryption, CMS background, Application requirements, Top 689@chapter CMS signing and encryption 690 691CMS is the Cryptographic Message System that among other, is used by 692S/MIME (secure email) and Kerberos PK-INIT. It's an extended version of 693the RSA, Inc standard PKCS7. 694 695@node CMS background, Certificate matching, CMS signing and encryption, Top 696@section CMS background 697 698 699@node Certificate matching, Matching syntax, CMS background, Top 700@chapter Certificate matching 701 702To match certificates hx509 have a special query language to match 703certifictes in queries and ACLs. 704 705@node Matching syntax, Software PKCS 11 module, Certificate matching, Top 706@section Matching syntax 707 708This is the language definitions somewhat slopply descriped: 709 710@example 711 712expr = TRUE, 713 FALSE, 714 ! expr, 715 expr AND expr, 716 expr OR expr, 717 ( expr ) 718 compare 719 720compare = 721 word == word, 722 word != word, 723 word IN ( word [, word ...]) 724 word IN %@{variable.subvariable@} 725 726word = 727 STRING, 728 %@{variable@} 729 730@end example 731 732@node Software PKCS 11 module, How to use the PKCS11 module, Matching syntax, Top 733@chapter Software PKCS 11 module 734 735PKCS11 is a standard created by RSA, Inc to support hardware and 736software encryption modules. It can be used by smartcard to expose the 737crypto primitives inside without exposing the crypto keys. 738 739Hx509 includes a software implementation of PKCS11 that runs within the 740memory space of the process and thus exposes the keys to the 741application. 742 743@node How to use the PKCS11 module, , Software PKCS 11 module, Top 744@section How to use the PKCS11 module 745 746@example 747$ cat > ~/.soft-pkcs11.rc <<EOF 748mycert cert User certificate FILE:/Users/lha/Private/pkinit.pem 749app-fatal true 750EOF 751$ kinit -C PKCS11:/usr/heimdal/lib/hx509.so lha@@EXAMPLE.ORG 752@end example 753 754 755@c @shortcontents 756@contents 757 758@bye 759