RFC 2510
Internet X.509 Public Key Infrastructure Certificate Management Protocols
Part 1 of 15 ๐
Title Block ๐
Okay bestie, the header is basically this doc's ID card, so let's start there ๐ชช
- RFC: 2510
- Title: Internet X.509 Public Key Infrastructure Certificate Management Protocols
- Authors: C. Adams (Entrust Technologies) and S. Farrell (SSE)
- Working group: Network Working Group
- Category: Standards Track
- Date: March 1999
- Obsoletes / Updates: the header doesn't list anything it obsoletes or updates โจ
Status of this Memo ๐ธ
So this is an Internet standards track protocol for the whole Internet community, and they're literally asking for discussion and suggestions ๐ซถ. For the current standardization state and status of this protocol, check the "Internet Official Protocol Standards" (STD 1), that's the source of truth. Distribution of this memo is unlimited, so share away ๐
Copyright Notice ๐ฆ
Copyright (C) The Internet Society (1999). All Rights Reserved.
Abstract ๐ง
This doc describes the Internet X.509 Public Key Infrastructure (PKI) Certificate Management Protocols. It defines protocol messages for all the relevant aspects of certificate creation and management ๐ฅ. Quick note: "certificate" here means an X.509v3 Certificate, as defined in [COR95, X509-AM].
The key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document (in uppercase, as shown) are to be interpreted as described in [RFC2119]. Those are the official BCP 14 power words, so when you see them in caps, they're doing serious work ๐
Introduction ๐
The layout of this document is as follows:
- Section 1 contains an overview of PKI management;
- Section 2 contains discussion of assumptions and restrictions;
- Section 3 contains data structures used for PKI management messages;
- Section 4 defines the functions that are to be carried out in PKI management by conforming implementations;
- Section 5 describes a simple protocol for transporting PKI messages;
- the Appendices specify profiles for conforming implementations and provide an ASN.1 module containing the syntax for all messages defined in this specification.
1 PKI Management Overview โจ
Okay so the PKI has to be built around the actual humans who run it ๐งโ๐ป. Give admins unlimited choices and the software gets way more complicated, and a subtle mistake by an admin or developer can turn into a much bigger compromise ๐. But if you restrict admins with clunky mechanisms, they just won't use the PKI at all. Main character energy is making it usable, not painful.
Management protocols are REQUIRED to support on-line interactions between Public Key Infrastructure (PKI) components ๐. For example, a management protocol might be used between a Certification Authority (CA) and a client system with which a key pair is associated, or between two CAs that issue cross-certificates for each other ๐ค.
1.1 PKI Management Model ๐
Before we get into specific message formats and procedures, we first define the entities involved in PKI management and how they interact (in terms of the PKI management functions required) ๐งฉ. Then we group these functions so they fit the different identifiable types of end entities.
1.2 Definitions of PKI Entities ๐
The entities involved in PKI management include the end entity (i.e., the entity to be named in the subject field of a certificate) and the certification authority (i.e., the entity named in the issuer field of a certificate). A registration authority MAY also be involved in PKI management ๐.
1.2.1 Subjects and End Entities ๐ซง
The term "subject" refers to the entity named in the subject field of a certificate. When we want to tell apart the tools and/or software the subject uses (like a local certificate management module), we say "subject equipment" ๐ ๏ธ. Generally, "end entity" (EE) is preferred over subject, so nobody gets confused with the field name ๐ญ.
The end entities here include not only human users of applications, but also the applications themselves (e.g., for IP security). This matters for the protocols PKI management uses. Application software is way more likely to know exactly which certificate extensions are required than human users are ๐ค. PKI management entities are also end entities in the sense that they're sometimes named in the subject field of a certificate or cross-certificate. Where it's useful, "end-entity" refers to end entities that aren't PKI management entities ๐ธ.
All end entities need secure local access to some information. At a minimum, that's their own name and private key, the name of a CA directly trusted by this entity, and that CA's public key (or a fingerprint of the public key where a self-certified version is available elsewhere) ๐. Implementations MAY use secure local storage for more than this minimum (e.g., the end entity's own certificate or application-specific information). The storage form varies too, from files all the way to tamper-resistant cryptographic tokens ๐ช. This local trusted storage is called the end entity's Personal Security Environment (PSE) ๐ .
PSE formats are beyond the scope of this document (they're very dependent on equipment, et cetera), but a generic interchange format for PSEs is defined here. A certification response message MAY be used for that ๐ฆ.
1.2.2 Certification Authority ๐
The certification authority (CA) may or may not be a real "third party" from the end entity's point of view. Honestly, the CA often belongs to the same organization as the end entities it supports ๐ข.
Again, "CA" refers to the entity named in the issuer field of a certificate. When we need to distinguish the software or hardware tools the CA uses, we say "CA equipment" ๐งฐ.
CA equipment will often have both an "off-line" component and an "on-line" component, with the CA private key only available to the "off-line" component. This is a matter for implementers, though it's also a policy issue ๐.
A "root CA" is a CA that an end entity directly trusts. In other words, securely getting a root CA public key takes some out-of-band step(s) ๐ต๏ธ. The term doesn't mean a root CA is necessarily at the top of any hierarchy, just that the CA is trusted directly ๐.
A "subordinate CA" is one that isn't a root CA for the end entity in question. Often a subordinate CA won't be a root CA for any entity, but that's not mandatory ๐.
1.2.3 Registration Authority ๐ท
Plenty of environments also have a Registration Authority (RA) that's separate from the Certification Authority ๐. The functions the RA carries out vary from case to case, but they MAY include personal authentication, token distribution, revocation reporting, name assignment, key generation, archival of key pairs, et cetera ๐๏ธ.
This document treats the RA as an OPTIONAL component. When there's no RA, the CA is assumed to be able to carry out the RA's functions, so the PKI management protocols look the same from the end-entity's point of view ๐ซถ.
Again, where necessary we distinguish between the RA and the tools it uses (the "RA equipment") ๐ง.
Note that an RA is itself an end entity. We also assume all RAs are in fact certified end entities and that RAs have private keys usable for signing. How a particular CA equipment identifies some end entities as RAs is an implementation issue (i.e., this document specifies no special RA certification operation). We don't mandate that the RA is certified by the CA it's interacting with at the moment, so one RA can work with more than one CA while only being certified once โจ.
In some circumstances, end entities talk directly to a CA even when an RA is present. For example, the subject may use its RA for initial registration and/or certification, but communicate directly with the CA to refresh its certificate ๐.
1.3. PKI Management Requirements โจ
okay bestie, this is the checklist ๐ the protocols in this doc have to hit these requirements for PKI management, and I'm obsessed with how thorough it is ๐ญ
- PKI management must conform to the ISO 9594-8 standard and its associated amendments (certificate extensions) ๐
- PKI management must conform to the other parts of this series. ๐ธ
- It must be possible to regularly update any key pair without affecting any other key pair. ๐ฆ
- The use of confidentiality in PKI management protocols must be kept to a minimum in order to ease regulatory problems. ๐
- PKI management protocols must allow the use of different industry-standard cryptographic algorithms (specifically including RSA, DSA, MD5, SHA-1). This means any given CA, RA, or end entity may, in principle, use whichever algorithms suit it for its own key pair(s). it's giving freedom of choice ๐
- PKI management protocols must not preclude the generation of key pairs by the end entity concerned, by an RA, or by a CA. Key generation may also happen elsewhere, but for PKI management purposes we can treat it as happening wherever the key is first present at an end entity, RA, or CA. ๐ง
- PKI management protocols must support the publication of certificates by the end entity concerned, by an RA, or by a CA. Different implementations and different environments may choose any of the above approaches. โจ
- PKI management protocols must support the production of Certificate Revocation Lists (CRLs) by letting certified end entities request revocation of certificates. This must be done in a way that does not make the possible denial-of-service attacks any simpler. ๐ฅ
- PKI management protocols must be usable over a variety of "transport" mechanisms, specifically including mail,
http, TCP/IP andftp. ๐ - Final authority for certificate creation rests with the CA. No RA or end-entity equipment can assume that a certificate issued by a CA will contain what was requested, because a CA may alter certificate field values or add, delete or alter extensions according to its operating policy. In other words, all PKI entities (end entities, RAs and CAs) must be capable of handling responses to certificate requests where the certificate actually issued is different from the one requested (for example, a CA may shorten the requested validity period). Note that policy may dictate that the CA must not publish or otherwise distribute the certificate until the requesting entity has reviewed and accepted the newly created certificate (typically through use of the
PKIConfirmmessage). ๐ - A graceful, scheduled change-over from one non-compromised CA key pair to the next (CA key update) must be supported. Note that if the CA key is compromised, re-initialization must be performed for all entities in the domain of that CA. An end entity whose PSE contains the new CA public key (following a CA key update) must also be able to verify certificates verifiable using the old public key. End entities who directly trust the old CA key pair must also be able to verify certificates signed using the new CA private key. (This is required for situations where the old CA public key is "hardwired" into the end entity's cryptographic equipment.) ๐ญ
- The functions of an RA may, in some implementations or environments, be carried out by the CA itself. The protocols must be designed so that end entities use the same protocol (but, of course, not the same key!) regardless of whether they are communicating with an RA or a CA. ๐
- Where an end entity requests a certificate containing a given public key value, the end entity must be ready to demonstrate possession of the corresponding private key value. This may be accomplished in various ways, depending on the type of certification request. See Section 2.3, "Proof of Possession of Private Key", for details of the in-band methods defined for the PKIX-CMP (i.e., Certificate Management Protocol) messages. main character energy, the whole way through ๐โจ
1.4. PKI Management Operations ๐บ๏ธ
Okay bestie, this diagram is giving main character energy ๐ . Every lettered line (a, b, c and so on) is a "protocol" in the sense that a defined set of PKI management messages can travel along it, so it's basically the map of who talks to who ๐ฆ.
+---+ cert. publish +------------+ j
| | <--------------------- | End Entity | <-------
| C | g +------------+ "out-of-band"
| | | ^ loading
| e | | | initial
| r | a | | b registration/
| t | | | certification
| | | | key pair recovery
| / | | | key pair update
| | | | certificate update
| C | PKI "USERS" V | revocation request
| R | -------------------+-+-----+-+------+-+-------------------
| L | PKI MANAGEMENT | ^ | ^
| | ENTITIES a | | b a | | b
| | V | | |
| R | g +------+ d | |
| e | <------------ | RA | <-----+ | |
| p | cert. | | ----+ | | |
| o | publish +------+ c | | | |
| s | | | | |
| i | V | V |
| t | g +------------+ i
| o | <------------------------| CA |------->
| r | h +------------+ "out-of-band"
| y | cert. publish | ^ publication
| | CRL publish | |
+---+ | | cross-certification
e | | f cross-certificate
| | update
| |
V |
+------+
| CA-2 |
+------+
Figure 1 - PKI Entities
Figure 1 - PKI Entities
At a high level, the operations that have management messages defined for them can be grouped like this ๐:
- CA establishment: When you're setting up a brand new CA, certain steps are required (e.g., production of initial CRLs, export of CA public key). ๐๏ธ
- End entity initialization: This includes importing a root CA public key and requesting information about the options supported by a PKI management entity. ๐ง
- Certification: Various operations result in the creation of new certificates ๐:
- 3.1 initial registration/certification: This is the process where an end entity first makes itself known to a CA or RA, before the CA issues a certificate or certificates for that end entity. When it works, the end result is that a CA issues a certificate for an end entity's public key, and returns that certificate to the end entity and/or posts that certificate in a public repository ๐. This process may, and typically will, involve multiple "steps", possibly including an initialization of the end entity's equipment. For example, the end entity's equipment must be securely initialized with the public key of a CA, so it can be used in validating certificate paths. Furthermore, an end entity typically needs to be initialized with its own key pair(s). ๐
- 3.2 key pair update: Every key pair needs to be updated regularly (i.e., replaced with a new key pair), and a new certificate needs to be issued. ๐
- 3.3 certificate update: As certificates expire, they may be "refreshed" if nothing relevant in the environment has changed. โณ
- 3.4 CA key pair update: As with end entities, CA key pairs need to be updated regularly. However, different mechanisms are required. ๐
- 3.5 cross-certification request: One CA requests issuance of a cross-certificate from another CA. For the purposes of this standard, the following terms are defined. A "cross-certificate" is a certificate in which the subject CA and the issuer CA are distinct and SubjectPublicKeyInfo contains a verification key (i.e., the certificate has been issued for the subject CA's signing key pair) โจ. When it's necessary to distinguish more finely, the following terms may be used: a cross-certificate is called an "inter-domain cross-certificate" if the subject and issuer CAs belong to different administrative domains. Otherwise, it is called an "intra-domain cross-certificate" ๐ฆ.
- 3.6 cross-certificate update: Similar to a normal certificate update, but involving a cross-certificate. ๐
Notes:
Note 1. The above definition of "cross-certificate" aligns with the defined term "CA-certificate" in X.509. Note that this term is not to be confused with the X.500 "cACertificate" attribute type, which is unrelated ๐.
Note 2. In many environments, the term "cross-certificate", unless further qualified, will be understood to be synonymous with "inter-domain cross-certificate" as defined above ๐.
Note 3. Issuance of cross-certificates may be, but is not necessarily, mutual. That is, two CAs may issue cross-certificates for each other ๐ค.
- Certificate/CRL discovery operations: Some PKI management operations result in the publication of certificates or CRLs ๐ข:
- 4.1 certificate publication: Having gone to the trouble of producing a certificate, you need some means for publishing it. The "means" defined in PKIX MAY involve the messages specified in Sections 3.3.13 - 3.3.16, or MAY involve other methods (LDAP, for example) as described in the "Operational Protocols" documents of the PKIX series of specifications ๐.
- 4.2 CRL publication: As for certificate publication. ๐
- Recovery operations: Some PKI management operations are used when an end entity has "lost" its PSE ๐ญ:
- 5.1 key pair recovery: As an option, user client key materials (e.g., a user's private key used for decryption purposes) MAY be backed up by a CA, an RA, or a key backup system associated with a CA or RA. If an entity needs to recover these backed up key materials (e.g., as a result of a forgotten password or a lost key chain file), a protocol exchange may be needed to support such recovery ๐.
- Revocation operations: Some PKI operations result in the creation of new CRL entries and/or new CRLs ๐ซ:
- 6.1 revocation request: An authorized person advises a CA of an abnormal situation requiring certificate revocation. ๐จ
- PSE operations: Whilst the definition of PSE operations (e.g., moving a PSE, changing a PIN, etc.) is beyond the scope of this specification, we do define a PKIMessage (CertRepMessage) which can form the basis of such operations ๐งฐ.
Note that on-line protocols are not the only way of implementing the above operations. For all operations there are off-line methods of achieving the same result, and this specification does not mandate use of on-line protocols. For example, when hardware tokens are used, many of the operations MAY be achieved as part of the physical token delivery ๐ฆ.
Later sections define a set of standard messages supporting the above operations. The protocols for conveying these exchanges in different environments (file based, on-line, E-mail, and WWW) are also specified ๐ธ.
2. Assumptions and restrictions โจ
2.1. End entity initialization ๐ฑ
The first step for an end entity in dealing with PKI management entities is to request information about the PKI functions supported, and to securely acquire a copy of the relevant root CA public key(s) ๐.
2.2. Initial registration/certification ๐
There are many schemes that can be used to achieve initial registration and certification of end entities. No one method is suitable for all situations, due to the range of policies which a CA may implement and the variation in the types of end entity which can occur ๐งฉ.
We can, however, classify the initial registration / certification schemes that are supported by this specification. Note that the word "initial", above, is crucial. We are dealing with the situation where the end entity in question has had no previous contact with the PKI ๐. Where the end entity already possesses certified keys, some simplifications and alternatives are possible.
Having classified the schemes that are supported by this specification, we can then specify some as mandatory and some as optional. The goal is that the mandatory schemes cover a sufficient number of the cases which will arise in real use, whilst the optional schemes are available for special cases which arise less frequently. In this way, we achieve a balance between flexibility and ease of implementation ๐ซถ.
We will now describe the classification of initial registration / certification schemes ๐.
2.2.1. Criteria used ๐
2.2.1.1. Initiation of registration / certification ๐
In terms of the PKI messages which are produced, we can regard the initiation of the initial registration / certification exchanges as occurring wherever the first PKI message relating to the end entity is produced. Note that the real-world initiation of the registration / certification procedure may occur elsewhere (e.g., a personnel department may telephone an RA operator) ๐.
The possible locations are at the end entity, an RA, or a CA ๐ข.
2.2.1.2. End entity message origin authentication ๐
The on-line messages produced by the end entity that requires a certificate may be authenticated or not. The requirement here is to authenticate the origin of any messages from the end entity to the PKI (CA/RA) ๐ต๏ธโโ๏ธ.
In this specification, such authentication is achieved by the PKI (CA/RA) issuing the end entity with a secret value (initial authentication key) and a reference value (used to identify the transaction) via some out-of-band means. The initial authentication key can then be used to protect relevant PKI messages ๐๏ธ.
We can thus classify the initial registration/certification scheme according to whether or not the on-line end entity -> PKI messages are authenticated ๐
.
Note 1: We do not discuss the authentication of the PKI -> end entity messages here, as this is always REQUIRED. In any case, it can be achieved simply once the root-CA public key has been installed at the end entity's equipment, or it can be based on the initial authentication key ๐.
Note 2: An initial registration / certification procedure can be secure where the messages from the end entity are authenticated via some out-of-band means (e.g., a subsequent visit) ๐ฆ.
2.2.1.3 Location of key generation โจ
okay so bestie, here's the big question for this one: where does "key generation" actually happen? ๐ค In this spec, we say key generation is considered to have happened wherever either the public or private part of a key pair first shows up in a PKIMessage. ๐ Lowkey genius, right? It does NOT rule out a centralized key generation service. The actual key pair MAY have been generated somewhere else and then moved over to the end entity, RA, or CA using a (proprietary or standardized) key generation request/response protocol. That protocol is outside the scope of this specification, so we're not going there ๐
So there are three possible locations for "key generation": the end entity, an RA, or a CA. ๐ That's it, that's the list, periodt ๐
2.2.1.4 Confirmation of successful certification ๐ฆ
after a CA makes an initial certificate for an end entity, you can get some extra assurance by having the end entity explicitly confirm that it successfully received the message containing the certificate (or the message that says the certificate was created) ๐ซถ Obsessed with this, honestly. And ngl, this confirmation message MUST be protected, based on the initial authentication key or some other means ๐
So that gives us two more possibilities: confirmed or not confirmed. โจ
2.2.2 Mandatory schemes ๐
the criteria above allow for a whole bunch of initial registration / certification schemes ๐ญ But this specification says conforming CA equipment, RA equipment, and EE equipment MUST support the second scheme listed below. ๐ Any entity MAY also support other schemes if it wants, no cap ๐
2.2.2.1 Centralized scheme ๐ธ
this one is, in some ways, the simplest possible, which is iconic ๐ง Here's the setup:
- initiation happens at the certifying CA;
- no online message authentication is required;
- "key generation" happens at the certifying CA (see Section 2.2.1.3);
- no confirmation message is required.
So in terms of message flow, the only message required is sent from the CA to the end entity ๐จ That message MUST contain the entire PSE for the end entity. Some out-of-band means MUST be provided so the end entity can authenticate the message it received and decrypt any encrypted values. Lowkey a lot of trust riding on that out-of-band channel, bestie ๐
2.2.2.2 Basic authenticated scheme ๐
in terms of the classification above, this scheme is where:
- initiation happens at the end entity;
- message authentication is REQUIRED;
- "key generation" happens at the end entity (see Section 2.2.1.3);
- a confirmation message is REQUIRED.
Message flow time ๐ฆ Here's how the basic authenticated scheme goes:
End entity RA/CA
========== =============
out-of-band distribution of Initial Authentication
Key (IAK) and reference value (RA/CA -> EE)
Key generation
Creation of certification request
Protect request with IAK
-->>--certification request-->>--
verify request
process request
create response
--<<--certification response--<<--
handle response
create confirmation
-->>--confirmation message-->>--
verify confirmation
(Where verification of the confirmation message fails, the RA/CA MUST revoke the newly issued certificate if it has been published or otherwise made available. ๐ญ Not me panicking on the RA/CA's behalf.)
2.3 Proof of Possession (POP) of Private Key ๐
okay this one is SO important ๐ฅ To prevent certain attacks, and so a CA/RA can properly check that the binding between an end entity and a key pair is valid, the PKI management operations here let an end entity prove that it has possession of (i.e., is able to use) the private key for the public key it's requesting a certificate for ๐ A given CA/RA gets to pick how to enforce POP (for example, out-of-band procedural means or PKIX-CMP in-band messages). That's basically a policy thing ๐ BUT it is REQUIRED that CAs/RAs MUST enforce POP by some means, because there are currently loads of non-PKIX operational protocols in use (various electronic mail protocols are one example) that don't explicitly check the binding between the end entity and the private key ๐ Until operational protocols that DO verify the binding (for signature, encryption, and key agreement key pairs) exist and are ubiquitous, this binding can only be assumed to have been verified by the CA/RA. So if the CA/RA doesn't verify the binding, certificates in the Internet Public-Key Infrastructure end up being somewhat less meaningful ๐ฅบ
POP works differently depending on the type of key the certificate is requested for. If a key can be used for multiple purposes (e.g., an RSA key), then any appropriate method MAY be used (e.g., a key which may be used for signing, as well as other purposes, SHOULD NOT be sent to the CA/RA in order to prove possession) โจ
This spec explicitly allows for cases where an end entity gives the proof to an RA, and then the RA tells the CA that the required proof was received (and validated!) ๐ซถ For example, an end entity that wants a signing key certified could send the signature to the RA, and the RA just notifies the relevant CA that the end entity supplied the proof. Of course, some policies might disallow this, like if CAs are the only entities allowed to verify POP during certification ๐ โโ๏ธ
2.3.1 Signature Keys ๐๏ธ
for signature keys, the end entity can sign a value to prove possession of the private key. Simple and slay ๐
2.3.2 Encryption Keys ๐
for encryption keys, the end entity can either hand the private key to the CA/RA, or it can be required to decrypt a value to prove possession of the private key (see Section 3.2.8). Decrypting a value can be done directly or indirectly ๐ฆ
The direct method is for the RA/CA to issue a random challenge that the EE has to respond to immediately ๐
The indirect method is to issue a certificate that's encrypted for the end entity, and have the end entity show it can decrypt that certificate in the confirmation message. This lets a CA issue a certificate in a form that can only be used by the intended end entity ๐ Iconic.
This spec ENCOURAGES the indirect method, because it needs no extra messages to be sent (the proof can be shown using the {request, response, confirmation} triple of messages) ๐ง
2.3.3 Key Agreement Keys ๐
for key agreement keys, the end entity and the PKI management entity (i.e., CA or RA) MUST establish a shared secret key to prove that the end entity has possession of the private key. ๐
Note that this doesn't put any restrictions on the keys a given CA can certify. In particular, for Diffie-Hellman keys the end entity may freely choose its algorithm parameters ๐ As long as the CA can generate a short-term (or one-time) key pair with the right parameters when it's needed, we're good ๐ธ
2.4 Root CA key update ๐
this only applies to CAs that are a root CA for some end entity ๐ง
The basic idea is that the CA protects its new public key using its previous private key, and vice versa ๐ฆ So when a CA updates its key pair, it MUST generate two extra cACertificate attribute values if certificates are made available using an X.500 directory (four total: OldWithOld, OldWithNew, NewWithOld, and NewWithNew). Periodt ๐
When a CA changes its key pair, the end entities who got the old CA public key through "out-of-band" means are the most affected. These are the end entities who will need the new CA public key protected with the old CA private key ๐ฅบ They only need it for a limited time, though (until they've gotten the new CA public key through the "out-of-band" mechanism). This will usually be easy once these end entities' certificates expire โจ
The data structure used to protect the new and old CA public keys is a standard certificate (which may also contain extensions). No new data structures are required ๐
Note 1. This scheme does not make use of any of the X.509 v3 extensions, because it has to work even for version 1 certificates. The presence of the KeyIdentifier extension would make for efficiency improvements. ๐ค
Note 2. While the scheme could be generalized to cover cases where the CA updates its key pair more than once during the validity period of one of its end entities' certificates, this generalization seems of dubious value. Not having this generalization simply means that the validity period of a CA key pair must be greater than the validity period of any certificate issued by that CA using that key pair. ๐
Note 3. This scheme forces end entities to acquire the new CA public key when the last certificate they owned that was signed with the old CA private key expires (via the "out-of-band" means). Certificate and/or key update operations occurring at other times do not necessarily require this (depending on the end entity's equipment). ๐ธ
2.4.1 CA Operator actions ๐ฅ
to change the key of the CA, the CA operator does the following:
- Generate a new key pair;
- Create a certificate containing the old CA public key signed with the new private key (the "old with new" certificate);
- Create a certificate containing the new CA public key signed with the old private key (the "new with old" certificate);
- Create a certificate containing the new CA public key signed with the new private key (the "new with new" certificate);
- Publish these new certificates via the directory and/or other means (perhaps using a CAKeyUpdAnn message);
- Export the new CA public key so that end entities may acquire it using the "out-of-band" mechanism (if required).
The old CA private key is then no longer required ๐ซถ The old CA public key will, however, stay in use for some time. The time when the old CA public key is no longer required (other than for non-repudiation) is when all end entities of this CA have securely acquired the new CA public key ๐
The "old with new" certificate MUST have a validity period starting at the generation time of the old key pair and ending at the expiry date of the old public key. ๐
The "new with old" certificate MUST have a validity period starting at the generation time of the new key pair and ending at the time by which all end entities of this CA will securely possess the new CA public key (at the latest, the expiry date of the old public key). ๐ฆ
The "new with new" certificate MUST have a validity period starting at the generation time of the new key pair and ending at the time by which the CA will next update its key pair. ๐
2.4.2 Verifying Certificates
Okay so, normally when you verify a signature, the verifier checks (among other things) the certificate holding the signer's public key ๐ . But once a CA is allowed to update its key, a whole bunch of new possibilities show up ๐ญ. Here's the tea:
Repository contains NEW Repository contains only OLD
and OLD public keys public key (due to, e.g.,
delay in publication)
PSE PSE Contains PSE Contains PSE Contains
Contains OLD public NEW public OLD public
NEW public key key key
key
Signer's Case 1: Case 3: Case 5: Case 7:
certifi- This is In this case Although the In this case
cate is the the verifier CA operator the CA
protected standard must access has not operator has
using NEW case where the updated the not updated
public the directory in directory the the directory
key verifier order to get verifier can and so the
can the value of verify the verification
directly the NEW certificate will FAIL
verify the public key directly -
certificate this is thus
without the same as
using the case 1.
directory
Signer's Case 2: Case 4: Case 6: Case 8:
certifi- In this In this case The verifier Although the
cate is case the the verifier thinks this CA operator
protected verifier can directly is the has not
using OLD must verify the situation of updated the
public access the certificate case 2 and directory the
key directory without will access verifier can
in order using the the verify the
to get the directory directory; certificate
value of however, the directly -
the OLD verification this is thus
public key will FAIL the same as
case 4.
2.4.2.1 Verification in cases 1, 4, 5 and 8.
In these cases the verifier has a local copy of the CA public key, so it can verify the certificate directly. โจ This is exactly the same as the situation where no key change has occurred.
Note that case 8 may arise between the time when the CA operator has generated the new key pair and the time when the CA operator stores the updated attributes in the directory. Case 5 can only arise if the CA operator has issued both the signer's and verifier's certificates during this "gap". The CA operator SHOULD avoid this, because it leads to the failure cases described below ๐.
2.4.2.2 Verification in case 2.
In case 2, the verifier has to get access to the old public key of the CA. Here's what it does:
- Look up the
caCertificateattribute in the directory and pick the OldWithNew certificate (determined based on validity periods); - Verify that this is correct using the new CA key (which the verifier has locally);
- If correct, check the signer's certificate using the old CA key.
Case 2 shows up when the CA operator has issued the signer's certificate, changed key, and then issued the verifier's certificate. So yeah, it's a super typical case ๐ซถ.
2.4.2.3 Verification in case 3.
In case 3, the verifier has to get access to the new public key of the CA. Here's the move:
- Look up the
CACertificateattribute in the directory and pick the NewWithOld certificate (determined based on validity periods); - Verify that this is correct using the old CA key (which the verifier has stored locally);
- If correct, check the signer's certificate using the new CA key.
Case 3 shows up when the CA operator has issued the verifier's certificate, changed key, and then issued the signer's certificate. Also a very typical case ๐ธ.
2.4.2.4 Failure of verification in case 6.
In this case the CA has issued the verifier's PSE containing the new key without updating the directory attributes. ๐ That means the verifier has no way to get a trustworthy version of the CA's old key, so verification fails.
Note that the failure is the CA operator's fault. ๐
2.4.2.5 Failure of verification in case 7.
In this case the CA has issued the signer's certificate, protected with the new key, without updating the directory attributes. ๐ฉ That means the verifier has no way to get a trustworthy version of the CA's new key, so verification fails.
Note that the failure is, once again, the CA operator's fault. ๐
2.4.3 Revocation - Change of CA key
As we saw above, verifying a certificate gets way more complex once the CA is allowed to change its key. ๐ Revocation checks have the same problem, because the CA may have signed the CRL using a newer private key than the one inside the user's PSE.
The analysis of the alternatives is the same as for certificate verification.
3. Data Structures โจ
This section contains descriptions of the data structures required for PKI management messages. Section 4 describes constraints on their values and the sequence of events for each of the various PKI management operations. Section 5 describes how these may be encapsulated in various transport mechanisms. ๐
3.1 Overall PKI Message
Every message used in this spec for PKI management uses the following structure ๐ง:
PKIMessage ::= SEQUENCE {
header PKIHeader,
body PKIBody,
protection [0] PKIProtection OPTIONAL,
extraCerts [1] SEQUENCE SIZE (1..MAX) OF Certificate OPTIONAL
}
The PKIHeader holds info that's common to lots of PKI messages.
The PKIBody holds message-specific info.
The PKIProtection, when it's used, holds the bits that protect the PKI message.
The extraCerts field can hold certificates that might be useful to the recipient. For example, a CA or RA can use it to show an end entity the certificates it needs to verify its own new certificate (say, if the CA that issued the end entity's certificate isn't a root CA for the end entity). โจ Heads up: this field doesn't necessarily contain a certification path. The recipient may have to sort, select from, or otherwise process the extra certificates before using them ๐ค.
3.1.1 PKI Message Header
Every PKI message needs some header info for addressing and transaction identification ๐. Some of this info also shows up in a transport-specific envelope, but if the PKI message is protected then this info is protected too (we make no assumption about secure transport, so no cheating ๐ โโ๏ธ).
Here's the data structure for that info:
PKIHeader ::= SEQUENCE {
pvno INTEGER { ietf-version2 (1) },
sender GeneralName,
-- identifies the sender
recipient GeneralName,
-- identifies the intended recipient
messageTime [0] GeneralizedTime OPTIONAL,
-- time of production of this message (used when sender
-- believes that the transport will be "suitable"; i.e.,
-- that the time will still be meaningful upon receipt)
protectionAlg [1] AlgorithmIdentifier OPTIONAL,
-- algorithm used for calculation of protection bits
senderKID [2] KeyIdentifier OPTIONAL,
recipKID [3] KeyIdentifier OPTIONAL,
-- to identify specific keys used for protection
transactionID [4] OCTET STRING OPTIONAL,
-- identifies the transaction; i.e., this will be the same in
-- corresponding request, response and confirmation messages
senderNonce [5] OCTET STRING OPTIONAL,
recipNonce [6] OCTET STRING OPTIONAL,
-- nonces used to provide replay protection, senderNonce
-- is inserted by the creator of this message; recipNonce
-- is a nonce previously inserted in a related message by
-- the intended recipient of this message
freeText [7] PKIFreeText OPTIONAL,
-- this may be used to indicate context-specific instructions
-- (this field is intended for human consumption)
generalInfo [8] SEQUENCE SIZE (1..MAX) OF
InfoTypeAndValue OPTIONAL
-- this may be used to convey context-specific information
-- (this field not primarily intended for human consumption)
}
PKIFreeText ::= SEQUENCE SIZE (1..MAX) OF UTF8String
-- text encoded as UTF-8 String (note: each UTF8String SHOULD
-- include an RFC 1766 language tag to indicate the language
-- of the contained text)
The pvno field is fixed at one for this version of the spec. ๐
The sender field holds the name of the PKIMessage's sender. This name (together with senderKID, if it's supplied) should be usable to verify the protection on the message. โ If the sending entity doesn't know anything about the sender (for example, in the init. req. message, where the end entity may not know its own Distinguished Name (DN), e-mail name, IP address, etc.), then the "sender" field MUST contain a "NULL" value. That means the SEQUENCE OF relative distinguished names is of zero length ๐ซ . In that case the senderKID field MUST hold an identifier (a reference number) that tells the receiver which shared secret info to use to verify the message.
The recipient field holds the name of the PKIMessage's recipient. This name (together with recipKID, if it's supplied) should be usable to verify the protection on the message. ๐
The protectionAlg field says which algorithm was used to protect the message. If no protection bits are supplied (remember, PKIProtection is OPTIONAL), then this field MUST be omitted. If protection bits are supplied, then this field MUST be supplied ๐.
senderKID and recipKID can tell you which keys were used to protect the message. (recipKID will normally only be needed when the protection uses Diffie-Hellman (DH) keys ๐ฆ.)
The transactionID field in the message header MAY be used so the recipient of a response can match it up with a request it already got. This matters because an RA might have a bunch of requests "outstanding" at any given moment ๐.
The senderNonce and recipNonce fields protect the PKIMessage against replay attacks ๐ก๏ธ.
The messageTime field holds the time the sender created the message. This can help end entities fix their local clock so it matches a central system โฐ.
The freeText field can carry a human-readable message to the recipient, in as many languages as you like ๐. The first language in the sequence is the one that replies should use ๐.
The generalInfo field can carry extra machine-processable data for the recipient ๐ค.
3.1.2. PKI Message Body ๐
Okay so the PKIBody is basically a big CHOICE menu ๐ Every message type gets its own slot, and each slot has a tag number so the receiver knows exactly what it's looking at โจ
PKIBody ::= CHOICE { -- message-specific body elements
ir [0] CertReqMessages, --Initialization Request
ip [1] CertRepMessage, --Initialization Response
cr [2] CertReqMessages, --Certification Request
cp [3] CertRepMessage, --Certification Response
p10cr [4] CertificationRequest, --PKCS #10 Cert. Req.
-- the PKCS #10 certification request (see [PKCS10])
popdecc [5] POPODecKeyChallContent, --pop Challenge
popdecr [6] POPODecKeyRespContent, --pop Response
kur [7] CertReqMessages, --Key Update Request
kup [8] CertRepMessage, --Key Update Response
krr [9] CertReqMessages, --Key Recovery Request
krp [10] KeyRecRepContent, --Key Recovery Response
rr [11] RevReqContent, --Revocation Request
rp [12] RevRepContent, --Revocation Response
ccr [13] CertReqMessages, --Cross-Cert. Request
ccp [14] CertRepMessage, --Cross-Cert. Response
ckuann [15] CAKeyUpdAnnContent, --CA Key Update Ann.
cann [16] CertAnnContent, --Certificate Ann.
rann [17] RevAnnContent, --Revocation Ann.
crlann [18] CRLAnnContent, --CRL Announcement
conf [19] PKIConfirmContent, --Confirmation
nested [20] NestedMessageContent, --Nested Message
genm [21] GenMsgContent, --General Message
genp [22] GenRepContent, --General Response
error [23] ErrorMsgContent --Error Message
}
The specific types are described in Section 3.3 below. ๐ฆ
3.1.3. PKI Message Protection ๐
Some PKI messages will be protected for integrity. (Note that if an asymmetric algorithm is used to protect a message and the relevant public component has been certified already, then the origin of message can also be authenticated. On the other hand, if the public component is uncertified then the message origin cannot be automatically authenticated, but may be authenticated via out-of-band means.) Basically, if the key is already certified, you can prove who sent it ๐ต๏ธโโ๏ธ but if it isn't, you need some out-of-band help ๐
When protection is applied the following structure is used:
PKIProtection ::= BIT STRING
The input to the calculation of PKIProtection is the DER encoding of the following data structure:
ProtectedPart ::= SEQUENCE {
header PKIHeader,
body PKIBody
}
There MAY be cases in which the PKIProtection BIT STRING is deliberately not used to protect a message (i.e., this OPTIONAL field is omitted) because other protection, external to PKIX, will instead be applied. Such a choice is explicitly allowed in this specification. ๐ธ Examples of such external protection include PKCS #7 [PKCS7] and Security Multiparts [RFC1847] encapsulation of the PKIMessage (or simply the PKIBody (omitting the CHOICE tag), if the relevant PKIHeader information is securely carried in the external mechanism); specification of external protection using PKCS #7 will be provided in a separate document. It is noted, however, that many such external mechanisms require that the end entity already possesses a public-key certificate, and/or a unique Distinguished Name, and/or other such infrastructure-related information. Thus, they may not be appropriate for initial registration, key-recovery, or any other process with "boot-strapping" characteristics. For those cases it may be necessary that the PKIProtection parameter be used. In the future, if/when external mechanisms are modified to accommodate boot-strapping scenarios, the use of PKIProtection may become rare or non-existent. ๐ง
Depending on the circumstances the PKIProtection bits may contain a Message Authentication Code (MAC) or signature. Only the following cases can occur:
- shared secret information
In this case the sender and recipient share secret information (established via out-of-band means or from a previous PKI management operation). PKIProtection will contain a MAC value and the protectionAlg will be the following:
PasswordBasedMac ::= OBJECT IDENTIFIER --{1 2 840 113533 7 66 13}
PBMParameter ::= SEQUENCE {
salt OCTET STRING,
owf AlgorithmIdentifier,
-- AlgId for a One-Way Function (SHA-1 recommended)
iterationCount INTEGER,
-- number of times the OWF is applied
mac AlgorithmIdentifier
-- the MAC AlgId (e.g., DES-MAC, Triple-DES-MAC [PKCS11],
} -- or HMAC [RFC2104, RFC2202])
In the above protectionAlg the salt value is appended to the shared secret input. The OWF is then applied iterationCount times, where the salted secret is the input to the first iteration and, for each successive iteration, the input is set to be the output of the previous iteration. The output of the final iteration (called "BASEKEY" for ease of reference, with a size of "H") is what is used to form the symmetric key. If the MAC algorithm requires a K-bit key and K <= H, then the most significant K bits of BASEKEY are used. If K > H, then all of BASEKEY is used for the most significant H bits of the key, OWF("1" || BASEKEY) is used for the next most significant H bits of the key, OWF("2" || BASEKEY) is used for the next most significant H bits of the key, and so on, until all K bits have been derived. [Here "N" is the ASCII byte encoding the number N and "||" represents concatenation.] ๐
- DH key pairs
Where the sender and receiver possess Diffie-Hellman certificates with compatible DH parameters, then in order to protect the message the end entity must generate a symmetric key based on its private DH key value and the DH public key of the recipient of the PKI message. PKIProtection will contain a MAC value keyed with this derived symmetric key and the protectionAlg will be the following:
DHBasedMac ::= OBJECT IDENTIFIER --{1 2 840 113533 7 66 30}
DHBMParameter ::= SEQUENCE {
owf AlgorithmIdentifier,
-- AlgId for a One-Way Function (SHA-1 recommended)
mac AlgorithmIdentifier
-- the MAC AlgId (e.g., DES-MAC, Triple-DES-MAC [PKCS11],
} -- or HMAC [RFC2104, RFC2202])
In the above protectionAlg OWF is applied to the result of the Diffie-Hellman computation. The OWF output (called "BASEKEY" for ease of reference, with a size of "H") is what is used to form the symmetric key. If the MAC algorithm requires a K-bit key and K <= H, then the most significant K bits of BASEKEY are used. If K > H, then all of BASEKEY is used for the most significant H bits of the key, OWF("1" || BASEKEY) is used for the next most significant H bits of the key, OWF("2" || BASEKEY) is used for the next most significant H bits of the key, and so on, until all K bits have been derived. [Here "N" is the ASCII byte encoding the number N and "||" represents concatenation.] ๐
- signature
Where the sender possesses a signature key pair it may simply sign the PKI message. PKIProtection will contain the signature value and the protectionAlg will be an AlgorithmIdentifier for a digital signature (e.g., md5WithRSAEncryption or dsaWithSha-1). โ๏ธ
- multiple protection
In cases where an end entity sends a protected PKI message to an RA, the RA MAY forward that message to a CA, attaching its own protection (which MAY be a MAC or a signature, depending on the information and certificates shared between the RA and the CA). This is accomplished by nesting the entire message sent by the end entity within a new PKI message. The structure used is as follows.
NestedMessageContent ::= PKIMessage
3.2. Common Data Structures ๐
Before specifying the specific types that may be placed in a PKIBody we define some data structures that are used in more than one case. ๐ซถ
3.2.1. Requested Certificate Contents ๐
Various PKI management messages require that the originator of the message indicate some of the fields that are required to be present in a certificate. The CertTemplate structure allows an end entity or RA to specify as much as it wishes about the certificate it requires. CertTemplate is identical to a Certificate but with all fields optional.
Note that even if the originator completely specifies the contents of a certificate it requires, a CA is free to modify fields within the certificate actually issued. If the modified certificate is unacceptable to the requester, the Confirmation message may be withheld, or an Error Message may be sent (with a PKIStatus of "rejection"). ๐ฌ
See [CRMF] for CertTemplate syntax.
3.2.2. Encrypted Values ๐
Where encrypted values (restricted, in this specification, to be either private keys or certificates) are sent in PKI messages the EncryptedValue data structure is used.
See [CRMF] for EncryptedValue syntax.
Use of this data structure requires that the creator and intended recipient respectively be able to encrypt and decrypt. Typically, this will mean that the sender and recipient have, or are able to generate, a shared secret key. ๐๏ธ
If the recipient of the PKIMessage already possesses a private key usable for decryption, then the encSymmKey field MAY contain a session key encrypted using the recipient's public key. โจ
3.2.3 Status codes and Failure Information for PKI messages โจ
Okay so every response message is gonna carry some status info, bestie ๐ Here are the values that are defined:
PKIStatus ::= INTEGER {
granted (0),
-- you got exactly what you asked for
grantedWithMods (1),
-- you got something like what you asked for; the
-- requester is responsible for ascertaining the differences
rejection (2),
-- you don't get it, more information elsewhere in the message
waiting (3),
-- the request body part has not yet been processed,
-- expect to hear more later
revocationWarning (4),
-- this message contains a warning that a revocation is
-- imminent
revocationNotification (5),
-- notification that a revocation has occurred
keyUpdateWarning (6)
-- update already done for the oldCertId specified in
-- the key update request message
}
Responders may use the following syntax to spill more tea about failure cases ๐ since there's more than one way to fail, obviously.
PKIFailureInfo ::= BIT STRING {
-- since we can fail in more than one way!
-- More codes may be added in the future if/when required.
badAlg (0),
-- unrecognized or unsupported Algorithm Identifier
badMessageCheck (1),
-- integrity check failed (e.g., signature did not verify)
badRequest (2),
-- transaction not permitted or supported
badTime (3),
-- messageTime was not sufficiently close to the system time,
-- as defined by local policy
badCertId (4),
-- no certificate could be found matching the provided criteria
badDataFormat (5),
-- the data submitted has the wrong format
wrongAuthority (6),
-- the authority indicated in the request is different from the
-- one creating the response token
incorrectData (7),
-- the requester's data is incorrect (used for notary services)
missingTimeStamp (8),
-- when the timestamp is missing but should be there (by policy)
badPOP (9)
-- the proof-of-possession failed
}
PKIStatusInfo ::= SEQUENCE {
status PKIStatus,
statusString PKIFreeText OPTIONAL,
failInfo PKIFailureInfo OPTIONAL
}
3.2.4 Certificate Identification โจ
If you wanna point at one particular certificate, the CertId data structure is your go-to ๐
See [CRMF] for CertId syntax.
3.2.5 "Out-of-band" root CA public key ๐
Each root CA must be able to publish its current public key through some "out-of-band" means. Those mechanisms are beyond the scope of this document, but we define data structures that can support them, so we're not totally ghosting you ๐ซถ
There are generally two methods available. Either the CA directly publishes its self-signed certificate, or the info lives in the Directory (or something equivalent) and the CA publishes a hash of that value so you can check its integrity before using it. ๐ง
OOBCert ::= Certificate
The fields within this certificate are restricted as follows:
- The certificate MUST be self-signed (i.e., the signature must be verifiable using the SubjectPublicKeyInfo field);
- The subject and issuer fields MUST be identical;
- If the subject field is NULL then both subjectAltNames and issuerAltNames extensions MUST be present and have exactly the same value;
- The values of all other extensions must be suitable for a self-signed certificate (e.g., key identifiers for subject and issuer must be the same).
OOBCertHash ::= SEQUENCE {
hashAlg [0] AlgorithmIdentifier OPTIONAL,
certId [1] CertId OPTIONAL,
hashVal BIT STRING
-- hashVal is calculated over the self-signed
-- certificate with the identifier certID.
}
The whole point of the hash is that anyone who has securely received it (through the out-of-band means) can verify a self-signed certificate for that CA. That's giving security-checking energy ๐
3.2.6 Archive Options ๐ฆ
Requesters may indicate that they wish the PKI to archive a private key value using the PKIArchiveOptions structure.
See [CRMF] for PKIArchiveOptions syntax.
3.2.7 Publication Information ๐ฃ
Requesters may indicate that they wish the PKI to publish a certificate using the PKIPublicationInfo structure.
See [CRMF] for PKIPublicationInfo syntax.
3.2.8 Proof-of-Possession Structures ๐
Okay so if the certification request is for a signing key pair (aka a request for a verification certificate), then proof of possession of the private signing key is shown through the POPOSigningKey structure.
See [CRMF] for POPOSigningKey syntax, but heads up, POPOSigningKeyInput has the following semantic stipulations in this specification.
POPOSigningKeyInput ::= SEQUENCE {
authInfo CHOICE {
sender [0] GeneralName,
-- from PKIHeader (used only if an authenticated identity
-- has been established for the sender (e.g., a DN from a
-- previously-issued and currently-valid certificate))
publicKeyMAC [1] PKMACValue
-- used if no authenticated GeneralName currently exists for
-- the sender; publicKeyMAC contains a password-based MAC
-- (using the protectionAlg AlgId from PKIHeader) on the
-- DER-encoded value of publicKey
},
publicKey SubjectPublicKeyInfo -- from CertTemplate
}
Now, if the certification request is for an encryption key pair (aka a request for an encryption certificate), then proof of possession of the private decryption key can be shown in one of three ways. ๐ฆ
- By including the private key (encrypted) in the CertRequest, inside the PKIArchiveOptions control structure.
- By having the CA return not the certificate itself but an encrypted certificate (that is, the certificate encrypted under a randomly-generated symmetric key, with that symmetric key encrypted under the public key the certification request is being made for). This is the "indirect" method mentioned previously in Section 2.3.2. The end entity proves knowledge of the private decryption key to the CA by MACing the PKIConfirm message using a key derived from this symmetric key. [Note that if more than one CertReqMsg is included in the PKIMessage, then the CA uses a different symmetric key for each CertReqMsg and the MAC uses a key derived from the concatenation of all these keys.] The MACing procedure uses the PasswordBasedMac AlgId defined in Section 3.1.
- By having the end entity engage in a challenge-response protocol (using the messages POPODecKeyChall and POPODecKeyResp, see below) between CertReqMessages and CertRepMessage. This is the "direct" method mentioned previously in Section 2.3.2. [This method would typically be used in an environment where an RA verifies POP and then makes a certification request to the CA on behalf of the end entity. In that scenario, the CA trusts the RA to have done POP correctly before the RA requests a certificate for the end entity.] The complete protocol then looks as follows (note that req' does not necessarily encapsulate req as a nested message):
EE RA CA
---- req ---->
<--- chall ---
---- resp --->
---- req' --->
<--- rep -----
---- conf --->
<--- rep -----
---- conf --->
This protocol is obviously much longer than the 3-way exchange in choice (2) above, but it lets a local Registration Authority get involved, and the cert itself isn't actually created until the proof of possession is complete. Main character energy ๐
If the cert request is for a key agreement key (KAK) pair, then the POP can use any of the 3 ways described above for enc. key pairs, with a couple of changes. (1) The parenthetical text of bullet 2) gets replaced with "(i.e., the certificate encrypted under the symmetric key derived from the CA's private KAK and the public key for which the certification request is being made)". (2) The first parenthetical text of the challenge field of "Challenge" below gets replaced with "(using PreferredSymmAlg (see Appendix B6) and a symmetric key derived from the CA's private KAK and the public key for which the certification request is being made)". Alternatively, the POP can use the POPOSigningKey structure given in [CRMF] (where the alg field is DHBasedMAC and the signature field is the MAC) as a fourth option, if the CA already has a D-H certificate that the EE knows about. ๐
The challenge-response messages for proving possession of a private decryption key are specified as follows (see [MvOV97, p.404] for details). This challenge-response exchange is tied to the preceding cert request message (and the later cert response and confirmation messages) by the nonces used in the PKIHeader and by the protection (MACing or signing) applied to the PKIMessage. ๐ซ
POPODecKeyChallContent ::= SEQUENCE OF Challenge
-- One Challenge per encryption key certification request (in the
-- same order as these requests appear in CertReqMessages).
Challenge ::= SEQUENCE {
owf AlgorithmIdentifier OPTIONAL,
-- MUST be present in the first Challenge; MAY be omitted in any
-- subsequent Challenge in POPODecKeyChallContent (if omitted,
-- then the owf used in the immediately preceding Challenge is
-- to be used).
witness OCTET STRING,
-- the result of applying the one-way function (owf) to a
-- randomly-generated INTEGER, A. [Note that a different
-- INTEGER MUST be used for each Challenge.]
challenge OCTET STRING
-- the encryption (under the public key for which the cert.
-- request is being made) of Rand, where Rand is specified as
-- Rand ::= SEQUENCE {
-- int INTEGER,
-- - the randomly-generated INTEGER A (above)
-- sender GeneralName
-- - the sender's name (as included in PKIHeader)
-- }
}
POPODecKeyRespContent ::= SEQUENCE OF INTEGER
-- One INTEGER per encryption key certification request (in the
-- same order as these requests appear in CertReqMessages). The
-- retrieved INTEGER A (above) is returned to the sender of the
-- corresponding Challenge.
3.3 Operation-Specific Data Structures ๐ง
3.3.1 Initialization Request ๐
An Initialization request message carries a CertReqMessages data structure as its PKIBody, and that structure specifies the certificate(s) being requested. Typically, SubjectPublicKeyInfo, KeyId, and Validity are the template fields that can be supplied for each certificate requested (see Appendix B profiles for more info). This message is meant for entities that are first initializing into the PKI. ๐ธ
See [CRMF] for CertReqMessages syntax.
3.3.2 Initialization Response ๐
okay so the Initialization response is the reply to the request. Its PKIBody is a CertRepMessage, which holds a PKIStatusInfo for each certificate you asked for, plus the subject certificate and maybe a private key ๐. That key is usually encrypted with a session key, and the session key is encrypted with the protocolEncKey, so it's double-wrapped and extra safe โจ
Check out Section 3.3.4 for the CertRepMessage syntax ๐ . One detail to know: if the PKI Message Protection is "shared secret information" (see Section 3.1.3), then any certificate sent in the caPubs field can be directly trusted by the initiator as a root CA certificate ๐ซถ
3.3.3 Registration/Certification Request ๐ฆ
the Registration/Certification request is for existing PKI entities who want extra certificates ๐ its PKIBody is a CertReqMessages structure that says exactly which certificates are being requested.
See [CRMF] for the CertReqMessages syntax ๐
Alternatively, the PKIBody MAY be a CertificationRequest ๐ธ This structure is fully specified by the ASN.1 structure CertificationRequest given in [PKCS10]. It might be needed for signing key pair requests when you need to interoperate with legacy systems, but it's strongly discouraged whenever it's not absolutely necessary ๐
3.3.4 Registration/Certification Response ๐
the registration response is a CertRepMessage too ๐ It has a status value for each certificate requested, and it can optionally include a CA public key, failure information, a subject certificate, and an encrypted private key โจ
CertRepMessage ::= SEQUENCE {
caPubs [1] SEQUENCE SIZE (1..MAX) OF Certificate OPTIONAL,
response SEQUENCE OF CertResponse
}
CertResponse ::= SEQUENCE {
certReqId INTEGER,
-- to match this response with corresponding request (a value
-- of -1 is to be used if certReqId is not specified in the
-- corresponding request)
status PKIStatusInfo,
certifiedKeyPair CertifiedKeyPair OPTIONAL,
rspInfo OCTET STRING OPTIONAL
-- analogous to the id-regInfo-asciiPairs OCTET STRING defined
-- for regInfo in CertReqMsg [CRMF]
}
CertifiedKeyPair ::= SEQUENCE {
certOrEncCert CertOrEncCert,
privateKey [0] EncryptedValue OPTIONAL,
publicationInfo [1] PKIPublicationInfo OPTIONAL
}
CertOrEncCert ::= CHOICE {
certificate [0] Certificate,
encryptedCert [1] EncryptedValue
}
Only one of the failInfo (in PKIStatusInfo) and certificate (in CertifiedKeyPair) fields can be present in each CertResponse ๐ It depends on the status. For some status values (e.g., waiting) neither of the optional fields will be present ๐ง
Here's the vibe with EncryptedCert ๐ Once you have it and the relevant decryption key, you can get the certificate. The whole point is that a CA can send back the value of a certificate, but only the intended recipient can actually get the real certificate ๐ฅ The benefit is that a CA can reply with a certificate even without proof that the requester is the end entity who can use the relevant private key. (The proof isn't obtained until the PKIConfirm message reaches the CA ๐.) So if the proof of possession goes wrong, the CA won't have to revoke that certificate ๐ญ iconic behaviour, honestly.
3.3.5 Key update request content ๐
for key update requests, we use the CertReqMessages syntax ๐ Usually SubjectPublicKeyInfo, KeyId, and Validity are the template fields you can fill in for each key being updated. This message is meant for requesting updates to existing certificates that are not revoked and not expired โจ
See [CRMF] for CertReqMessages syntax ๐
3.3.6 Key Update response content ๐ฆ
for key update responses, the CertRepMessage syntax is used ๐ซถ The response is identical to the initialization response.
See Section 3.3.4 for CertRepMessage syntax โจ
3.3.7 Key Recovery Request content ๐
for key recovery requests, the syntax is identical to the initialization request CertReqMessages ๐ Typically, SubjectPublicKeyInfo and KeyId are the template fields. They can be used to supply a signature public key that needs a certificate (see Appendix B profiles for more info ๐ธ).
See [CRMF] for CertReqMessages syntax. Note that if a key history is required, the requester MUST supply a Protocol Encryption Key control in the request message ๐จ
heads up: if you want key history, you need that Protocol Encryption Key control in your request. no skipping it ๐
3.3.8 Key recovery response content ๐
for key recovery responses, this syntax is used ๐ For some status values (e.g., waiting) none of the optional fields will be present โจ
KeyRecRepContent ::= SEQUENCE {
status PKIStatusInfo,
newSigCert [0] Certificate OPTIONAL,
caCerts [1] SEQUENCE SIZE (1..MAX) OF
Certificate OPTIONAL,
keyPairHist [2] SEQUENCE SIZE (1..MAX) OF
CertifiedKeyPair OPTIONAL
}
3.3.9 Revocation Request Content ๐ โโ๏ธ
when you want to revoke a certificate (or a few of them), this is the data structure you use ๐ The requester's name is already in the PKIHeader, so you don't need to repeat it here ๐
RevReqContent ::= SEQUENCE OF RevDetails
RevDetails ::= SEQUENCE {
certDetails CertTemplate,
-- allows requester to specify as much as they can about
-- the cert. for which revocation is requested
-- (e.g., for cases in which serialNumber is not available)
revocationReason ReasonFlags OPTIONAL,
-- the reason that revocation is requested
badSinceDate GeneralizedTime OPTIONAL,
-- indicates best knowledge of sender
crlEntryDetails Extensions OPTIONAL
-- requested crlEntryExtensions
}
3.3.10 Revocation Response Content ๐ซ
this is the reply to the message above โจ If it's produced, it goes back to the requester of the revocation. (A separate revocation announcement message MAY be sent to the subject of the certificate that was requested for revocation ๐ซถ)
RevRepContent ::= SEQUENCE {
status SEQUENCE SIZE (1..MAX) OF PKIStatusInfo,
-- in same order as was sent in RevReqContent
revCerts [0] SEQUENCE SIZE (1..MAX) OF CertId OPTIONAL,
-- IDs for which revocation was requested (same order as status)
crls [1] SEQUENCE SIZE (1..MAX) OF CertificateList OPTIONAL
-- the resulting CRLs (there may be more than one)
}
3.3.11 Cross certification request content ๐
cross certification requests use the same syntax (CertReqMessages) as normal certification requests ๐ There's one restriction though: the key pair MUST have been generated by the requesting CA, and the private key MUST NOT be sent to the responding CA ๐ซ๐
See [CRMF] for CertReqMessages syntax ๐
3.3.12 Cross certification response content ๐ท
cross certification responses use the same syntax (CertRepMessage) as normal certification responses โจ The restriction here is that no encrypted private key can be sent.
See Section 3.3.4 for CertRepMessage syntax ๐ฆ
3.3.13 CA Key Update Announcement content ๐ฃ
when a CA updates its own key pair, it MAY use the following data structure to announce the change ๐
CAKeyUpdAnnContent ::= SEQUENCE {
oldWithNew Certificate, -- old pub signed with new priv
newWithOld Certificate, -- new pub signed with old priv
newWithNew Certificate -- new pub signed with new priv
}
3.3.14 Certificate Announcement ๐ข
this structure MAY be used to announce that certificates exist ๐ง Heads up though: it's meant for cases (if any) where there's no existing way to publish certificates. It's NOT meant for places where X.500 is already how certificates get published ๐ โโ๏ธ
CertAnnContent ::= Certificate
3.3.15 Revocation Announcement โ ๏ธ
when a CA has revoked a certificate, or is about to, it MAY announce that (the upcoming event might be in the future) ๐
RevAnnContent ::= SEQUENCE {
status PKIStatus,
certId CertId,
willBeRevokedAt GeneralizedTime,
badSinceDate GeneralizedTime,
crlDetails Extensions OPTIONAL
-- extra CRL details(e.g., crl number, reason, location, etc.)
}
A CA MAY use this announcement to warn (or notify) a subject that its certificate is about to be revoked (or already has been) ๐ซถ This would typically happen when the revocation request didn't come from the subject themselves.
The willBeRevokedAt field holds the time when a new entry will be added to the relevant CRLs โฐ
3.3.16 CRL Announcement ๐
when a CA issues a new CRL (or a set of them), it MAY use the following data structure to announce this ๐
CRLAnnContent ::= SEQUENCE OF CertificateList
3.3.17 PKI Confirmation content ๐
this data structure shows up in three-way protocols as the final PKIMessage ๐ Its content is the same in every case. Actually, there's no content at all, because the PKIHeader already carries everything needed ๐
PKIConfirmContent ::= NULL
3.3.18 PKI General Message content ๐ง
InfoTypeAndValue ::= SEQUENCE {
infoType OBJECT IDENTIFIER,
infoValue ANY DEFINED BY infoType OPTIONAL
}
-- Example InfoTypeAndValue contents include, but are not limited to:
-- { CAProtEncCert = {id-it 1}, Certificate }
-- { SignKeyPairTypes = {id-it 2}, SEQUENCE OF AlgorithmIdentifier }
-- { EncKeyPairTypes = {id-it 3}, SEQUENCE OF AlgorithmIdentifier }
-- { PreferredSymmAlg = {id-it 4}, AlgorithmIdentifier }
-- { CAKeyUpdateInfo = {id-it 5}, CAKeyUpdAnnContent }
-- { CurrentCRL = {id-it 6}, CertificateList }
-- where {id-it} = {id-pkix 4} = {1 3 6 1 5 5 7 4}
-- This construct MAY also be used to define new PKIX Certificate
-- Management Protocol request and response messages, or general-
-- purpose (e.g., announcement) messages for future needs or for
-- specific environments.
GenMsgContent ::= SEQUENCE OF InfoTypeAndValue
-- May be sent by EE, RA, or CA (depending on message content).
-- The OPTIONAL infoValue parameter of InfoTypeAndValue will typically
-- be omitted for some of the examples given above. The receiver is
-- free to ignore any contained OBJ. IDs that it does not recognize.
-- If sent from EE to CA, the empty set indicates that the CA may send
-- any/all information that it wishes.
3.3.19 PKI General Response content ๐ธ
GenRepContent ::= SEQUENCE OF InfoTypeAndValue
-- The receiver is free to ignore any contained OBJ. IDs that it does
-- not recognize.
3.3.20 Error Message content ๐จ
this one is for error messages ๐
ErrorMsgContent ::= SEQUENCE {
pKIStatusInfo PKIStatusInfo,
errorCode INTEGER OPTIONAL,
-- implementation-specific error codes
errorDetails PKIFreeText OPTIONAL
-- implementation-specific error details
}
4. Mandatory PKI Management functions โจ
okay so this section is where we get into the stuff every single end entity and CA/RA implementation has to be able to do ๐ the PKI management functions from Section 1 get spelled out here. these are the "mandatory" ones, meaning every implementation MUST be able to provide them (maybe through one of the transport mechanisms in Section 5). basically this is the profile of what MUST be supported ๐ซถ
also, not every PKI management function ends up making a PKI message, so keep that in mind ๐ฆ
4.1 Root CA initialization
[See Section 1.2.2 for this document's definition of "root CA".]
bestie, when a root CA is brand new it has to make a "self-certificate" ๐ธ that's a Certificate structure following the profile defined for the "newWithNew" certificate issued after a root CA key update.
here's the thing: end entities that don't get the self-certificate through "out-of-band" means need a way to check it, so the CA also has to produce a fingerprint for its public key ๐ if an end entity grabs that fingerprint securely through some "out-of-band" means, it can verify the CA's self-certificate and then trust the other attributes inside it. the data structure that carries the fingerprint is the OOBCertHash โจ
4.2 Root CA key update
CA keys (just like all other keys) have a finite lifetime, so they need updating on a regular basis ๐ the certificates NewWithNew, NewWithOld, and OldWithNew (see Section 2.4.1) are issued by the CA to help. they let existing end entities who hold the current self-signed CA certificate (OldWithOld) move securely over to the new self-signed CA certificate (NewWithNew). they also help new end entities who will hold NewWithNew get OldWithOld securely so they can verify existing data ๐
4.3 Subordinate CA initialization
[See Section 1.2.2 for this document's definition of "subordinate CA".]
from the point of view of PKI management protocols, starting up a subordinate CA is the same as starting up an end entity ๐ง the only difference is that the subordinate CA must also produce an initial revocation list.
4.4 CRL production
before issuing any certificates, a newly established CA (one that issues CRLs) must produce "empty" versions of each CRL that it's going to produce periodically ๐
4.5 PKI information request
when a PKI entity (CA, RA, or EE) wants to find out the current status of a CA, it MAY send that CA a request for that information ๐
the CA must respond to the request by providing (at least) all of the information the requester asked for. if some of the information can't be provided, then an error must be conveyed to the requester ๐ญ
if PKIMessages are used to request and supply this PKI information, then the request must be the GenMsg message, the response must be the GenRep message, and the error must be the Error message. these messages are protected with a MAC based on shared secret information (i.e., PasswordBasedMAC) or with any other authenticated means (if the end entity already has an existing certificate) ๐
4.6 Cross certification
the requester CA is the CA that will become the subject of the cross-certificate, and the responder CA is the one that will become the issuer of that cross-certificate ๐
the requester CA must be "up and running" before it starts the cross-certification operation ๐ฅ
4.6.1 One-way request-response scheme:
okay this one is basically a one-way operation ๐ฆ when it succeeds, it creates exactly one new cross-certificate. if you need cross-certificates in "both directions", then each CA has to take its turn initiating a cross-certification operation (or use another scheme).
this scheme is a good fit when the two CAs can already verify each other's signatures (they share some common points of trust), or when there's an out-of-band way to verify where the certification request came from ๐ซถ
Detailed Description:
cross certification kicks off at one CA called the responder. the responder's CA administrator picks the CA they want to cross certify, and the responder CA equipment generates an authorization code โจ the responder CA administrator then passes that authorization code to the requester CA administrator by out-of-band means. the requester CA administrator types the authorization code into the requester CA to start the on-line exchange ๐
the authorization code is used for authentication and integrity. it gets turned into a symmetric key, and that symmetric key is used to generate Message Authentication Codes (MACs) on all the messages exchanged ๐
the requester CA starts the exchange by generating a random number (the requester random number). then it sends the cross certification request (ccr) message to the responder CA. the fields in this message are protected from modification with a MAC based on the authorization code ๐
when the responder CA gets the ccr message, it checks the protocol version, saves the requester random number, generates its own random number (the responder random number), and validates the MAC. next it generates (and archives, if it wants to) a new requester certificate. that certificate contains the requester CA public key and is signed with the responder CA signature private key ๐ the responder CA then replies with the cross certification response (ccp) message. the fields in this message are protected from modification with a MAC based on the authorization code ๐
when the requester CA gets the ccp message, it checks that its own system time is close to the responder CA system time, checks the received random numbers, and validates the MAC. the requester CA then responds with the PKIConfirm message. the fields in this message are protected from modification with a MAC based on the authorization code. the requester CA also writes the requester certificate to the Repository ๐
when the responder CA gets the PKIConfirm message, it checks the random numbers and validates the MAC ๐ฆ
Notes:
- the
ccrmessage must contain a "complete" certification request, meaning all fields (including, e.g., a BasicConstraints extension) must be specified by the requester CA ๐ - the
ccpmessage SHOULD contain the verification certificate of the responder CA. if it's there, the requester CA must then verify this certificate (for example, via the "out-of-band" mechanism) ๐ซถ
4.7 End entity initialization
just like CAs, end entities have to get initialized ๐ง initializing an end entity takes at least two steps:
- acquiring PKI information
- out-of-band verification of one root-CA public key
there are other possible steps too, like retrieving trust condition information and/or doing out-of-band verification of other CA public keys ๐ธ
4.7.1 Acquisition of PKI information
the information REQUIRED is:
- the current root-CA public key
- (if the certifying CA is not a root-CA) the certification path from the root CA to the certifying CA, together with appropriate revocation lists
- the algorithms and algorithm parameters which the certifying CA supports for each relevant usage
more info could be needed (like supported extensions or CA policy information) to make a certification request that actually succeeds ๐ but for simplicity, we don't mandate that the end entity gets this information through the PKI messages. the result is simply that some certification requests may fail (for example, if the end entity wants to generate its own encryption key but the CA doesn't allow that) ๐
the required information MAY be acquired as described in Section 4.5 โจ
4.7.2 Out-of-Band Verification of Root-CA Key
an end entity must securely possess the public key of its root CA ๐ one way to do that is to give the end entity the CA's self-certificate fingerprint through some secure "out-of-band" means. then the end entity can securely use the CA's self-certificate ๐
see Section 4.1 for further details ๐ฆ
4.8 Certificate Request
an initialized end entity MAY request a certificate at any time (as part of an update procedure, or for any other purpose) ๐ this request is made using the certification request (cr) message. if the end entity already has a signing key pair (with a corresponding verification certificate), then this cr message will typically be protected by the entity's digital signature ๐ซถ the CA sends back the new certificate (if the request succeeds) in a CertRepMessage ๐
4.9 Key Update
when a key pair is about to expire, the relevant end entity MAY request a key update. that means it MAY ask the CA to issue a new certificate for a new key pair ๐ the request is made using a key update request (kur) message. if the end entity already has a signing key pair (with a corresponding verification certificate), then this message will typically be protected by the entity's digital signature. the CA returns the new certificate (if the request succeeds) in a key update response (kup) message, which is syntactically identical to a CertRepMessage ๐
5. Transports ๐
the transport protocols below let end entities, RAs, and CAs pass PKI messages between each other ๐ฆ there's no requirement for specific security mechanisms at this level as long as the PKI messages are suitably protected. that means the OPTIONAL PKIProtection parameter gets used the way it's specified for each message ๐
5.1 File based protocol
a file containing a PKI message MUST contain only the DER encoding of one PKI message. in other words, there MUST be no extraneous header or trailer information in the file ๐
files like this can be used to move PKI messages around using, e.g., FTP ๐ธ
5.2 Direct TCP-Based Management Protocol โจ
okay bestie, this is the simple TCP-based protocol for carrying PKI messages ๐ง. It's giving "perfect when an end entity (or an RA) starts the convo and then just checks back to see if the answer is ready" ๐ .
If a PKI entity (RA or CA) starts the transaction, then an end entity must either supply a listener process or be supplied with a polling reference (see below) so it can pick up the PKI message from the PKI management component ๐ฆ.
The protocol basically assumes a listener process on an RA or CA that can accept PKI messages on a well-defined port (port number 829) ๐. Typically an initiator binds to this port and submits the initial PKI message for a given transaction ID. The responder replies with a PKI message and/or with a reference number to be used later when polling for the actual PKI message response ๐.
If a number of PKI response messages are going to be produced for a given request (say if some part of the request is handled more quickly than another), then a new polling reference is also returned ๐ธ.
When the final PKI response message has been picked up by the initiator, no new polling reference is supplied โจ.
The initiator of a transaction sends a "direct TCP-based PKI message" to the recipient, and the recipient responds with a similar message ๐ซถ.
A "direct TCP-based PKI message" consists of:
length (32-bits), flag (8-bits), value (defined below)
The length field contains the number of octets of the remainder of the message (i.e., number of octets of "value" plus one). All 32-bit values in this protocol are specified to be in network byte order. ๐
Here's the menu of message types ๐:
Message name flag value
pkiMsg '00'H DER-encoded PKI message
-- PKI message
pollRep '01'H polling reference (32 bits),
time-to-check-back (32 bits)
-- poll response where no PKI message response ready; use polling
-- reference value (and estimated time value) for later polling
pollReq '02'H polling reference (32 bits)
-- request for a PKI message response to initial message
negPollRep '03'H '00'H
-- no further polling responses (i.e., transaction complete)
partialMsgRep '04'H next polling reference (32 bits),
time-to-check-back (32 bits),
DER-encoded PKI message
-- partial response to initial message plus new polling reference
-- (and estimated time value) to use to get next part of response
finalMsgRep '05'H DER-encoded PKI message
-- final (and possibly sole) response to initial message
errorMsgRep '06'H human readable error message
-- produced when an error is detected (e.g., a polling reference is
-- received which doesn't exist or is finished with)
Where a PKIConfirm message is to be transported (always from the initiator to the responder), a pkiMsg message is sent and a negPollRep is returned ๐.
The sequence of messages that can occur looks like this โจ:
- a) end entity sends
pkiMsgand receives one ofpollRep,negPollRep,partialMsgReporfinalMsgRepin response. - b) end entity sends
pollReqmessage and receives one ofnegPollRep,partialMsgRep,finalMsgReporerrorMsgRepin response.
The "time-to-check-back" parameter is a 32-bit integer, defined to be the number of seconds that have elapsed since midnight, January 1, 1970, coordinated universal time. It gives an estimate of the time that the end entity should send its next pollReq โฐ๐ฆ.
5.3 Management Protocol via E-mail โจ
this part is about how we send the ASN.1-encoded messages from the protocol exchanges in Section 4 through Internet mail ๐.
Here's the simple MIME object ๐:
Content-Type: application/pkixcmp
Content-Transfer-Encoding: base64
<<the ASN.1 DER-encoded PKIX-CMP message, base64-encoded>>
This MIME object can be sent and received using common MIME processing engines, and it gives you a simple Internet mail transport for PKIX-CMP messages ๐. Implementations MAY wish to also recognize and use the application/x-pkixcmp MIME type (specified in earlier versions of this document) in order to support backward compatibility wherever applicable ๐.
5.4 Management Protocol via HTTP โจ
same energy as the last one, but this time it's the HyperText Transfer Protocol doing the carrying ๐. This subsection specifies how to convey the ASN.1-encoded messages for the protocol exchanges in Section 4 over HTTP ๐ .
Here's the MIME object ๐ฆ:
Content-Type: application/pkixcmp
<<the ASN.1 DER-encoded PKIX-CMP message>>
This MIME object can be sent and received using common HTTP processing engines over WWW links, and it gives you a simple browser-server transport for PKIX-CMP messages ๐ซถ. Implementations MAY wish to also recognize and use the application/x-pkixcmp MIME type (specified in earlier versions of this document) in order to support backward compatibility wherever applicable ๐.
Security Considerations ๐
This entire memo is about security mechanisms ๐, so this section is kinda the most important one, no cap ๐ญ.
One cryptographic consideration is worth explicitly spelling out. In the protocols specified above, when an end entity is required to prove possession of a decryption key, it is effectively challenged to decrypt something (its own certificate). This scheme (and many others!) could be vulnerable to an attack if the possessor of the decryption key in question could be fooled into decrypting an arbitrary challenge and returning the cleartext to an attacker. Although in this specification a number of other failures in security are required in order for this attack to succeed, it is conceivable that some future services (e.g., notary, trusted time) could potentially be vulnerable to such attacks. For this reason we re-iterate the general rule that implementations should be very careful about decrypting arbitrary "ciphertext" and revealing recovered "plaintext," since such a practice can lead to serious security vulnerabilities ๐จ.
Note also that exposing a private key to the CA/RA as a proof-of-possession technique can carry some security risks (depending upon whether or not the CA/RA can be trusted to handle such material appropriately). Implementers are advised to exercise caution in selecting and using this particular POP mechanism ๐.
References ๐
- [COR95] ISO/IEC JTC 1/SC 21, Technical Corrigendum 2 to ISO/IEC 9594-8: 1990 & 1993 (1995:E), July 1995.
- [CRMF] Myers, M., Adams, C., Solo, D. and D. Kemp, "Certificate Request Message Format", RFC 2511, March 1999.
- [MvOV97] A. Menezes, P. van Oorschot, S. Vanstone, "Handbook of Applied Cryptography", CRC Press, 1997.
- [PKCS7] RSA Laboratories, "The Public-Key Cryptography Standards (PKCS)", RSA Data Security Inc., Redwood City, California, November 1993 Release.
- [PKCS10] RSA Laboratories, "The Public-Key Cryptography Standards (PKCS)", RSA Data Security Inc., Redwood City, California, November 1993 Release.
- [PKCS11] RSA Laboratories, "The Public-Key Cryptography Standards - PKCS #11: Cryptographic token interface standard", RSA Data Security Inc., Redwood City, California, April 28, 1995.
- [RFC1847] Galvin, J., Murphy, S. Crocker, S. and N. Freed, "Security Multiparts for MIME: Multipart/Signed and Multipart/Encrypted", RFC 1847, October 1995.
- [RFC2104] Krawczyk, H., Bellare, M. and R. Canetti, "HMAC: Keyed Hashing for Message Authentication", RFC 2104, February 1997.
- [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
- [RFC2202] Cheng, P. and R. Glenn, "Test Cases for HMAC-MD5 and HMAC-SHA-1", RFC 2202, September 1997.
- [X509-AM] ISO/IEC JTC1/SC 21, Draft Amendments DAM 4 to ISO/IEC 9594-2, DAM 2 to ISO/IEC 9594-6, DAM 1 to ISO/IEC 9594-7, and DAM 1 to ISO/IEC 9594-8 on Certificate Extensions, 1 December, 1996.
Acknowledgements ๐ซถ
The authors gratefully acknowledge the contributions of various members of the PKIX Working Group. Many of these contributions significantly clarified and improved the utility of this specification ๐ท.
Authors' Addresses ๐
Carlisle Adams
Entrust Technologies
750 Heron Road, Suite E08,
Ottawa, Ontario
Canada K1V 1A7
EMail: cadams@entrust.com
Stephen Farrell
Software and Systems Engineering Ltd.
Fitzwilliam Court
Leeson Close
Dublin 2
IRELAND
EMail: stephen.farrell@sse.ie
APPENDIX A: Reasons for the presence of RAs ๐ง
The reasons that justify the presence of an RA can be split into those that are due to technical factors and those that are organizational in nature. Technical reasons include the following ๐ง.
- If hardware tokens are in use, then not all end entities will have the equipment needed to initialize these; the RA equipment can include the necessary functionality (this may also be a matter of policy).
- Some end entities may not have the capability to publish certificates; again, the RA may be suitably placed for this.
- The RA will be able to issue signed revocation requests on behalf of end entities associated with it, whereas the end entity may not be able to do this (if the key pair is completely lost).
Some of the organizational reasons that argue for the presence of an RA are the following ๐ข.
- It may be more cost effective to concentrate functionality in the RA equipment than to supply functionality to all end entities (especially if special token initialization equipment is to be used).
- Establishing RAs within an organization can reduce the number of CAs required, which is sometimes desirable.
- RAs may be better placed to identify people with their "electronic" names, especially if the CA is physically remote from the end entity.
- For many applications there will already be in place some administrative structure so that candidates for the role of RA are easy to find (which may not be true of the CA).
Appendix B. PKI Management Message Profiles. ๐
This appendix contains detailed profiles for those PKIMessages which MUST be supported by conforming implementations (see Section 4) ๐.
Profiles for the PKIMessages used in the following PKI management operations are provided:
- root CA key update
- information request/response
- cross-certification request/response (1-way)
- initial registration/certification
- basic authenticated scheme
- certificate request
- key update
<<Later versions of this document may extend the above to include profiles for the operations listed below (along with other operations, if desired).>>
- revocation request
- certificate publication
- CRL publication
B1. General Rules for interpretation of these profiles. ๐โจ
okay bestie, these are the house rules for reading every profile below ๐
- Where OPTIONAL or DEFAULT fields are not mentioned in individual profiles, they SHOULD be absent from the relevant message (i.e., a receiver can validly reject a message containing such fields as being syntactically incorrect). Mandatory fields are not mentioned if they have an obvious value (e.g.,
pvno). - Where structures occur in more than one message, they are separately profiled as appropriate.
- The algorithmIdentifiers from PKIMessage structures are profiled separately.
- A "special" X.500 DN is called the "NULL-DN"; this means a DN containing a zero-length SEQUENCE OF RelativeDistinguishedNames (its DER encoding is then
'3000'H). - Where a GeneralName is required for a field but no suitable value is available (e.g., an end entity produces a request before knowing its name) then the GeneralName is to be an X.500 NULL-DN (i.e., the Name field of the CHOICE is to contain a NULL-DN). This special value can be called a "NULL-GeneralName".
- Where a profile omits to specify the value for a GeneralName then the NULL-GeneralName value is to be present in the relevant PKIMessage field. This occurs with the sender field of the PKIHeader for some messages.
- Where any ambiguity arises due to naming of fields, the profile names these using a "dot" notation (e.g.,
certTemplate.subjectmeans the subject field within a field called certTemplate). - Where a "SEQUENCE OF types" is part of a message, a zero-based array notation is used to describe fields within the SEQUENCE OF (e.g.,
crm[0].certReq.certTemplate.subjectrefers to a subfield of the first CertReqMsg contained in a request message). - All PKI message exchanges in Sections B7-B10 require a PKIConfirm message to be sent by the initiating entity. This message is not included in some of the profiles given since its body is NULL and its header contents are clear from the context. Any authenticated means can be used for the protectionAlg (e.g., password-based MAC, if shared secret information is known, or signature).
B2. Algorithm Use Profile ๐งฎ๐
Here's the cheat sheet of which algorithms get used where in PKI management protocols. Think of it as the algorithm matchmaking table ๐
The columns in the table are:
- Name: an identifier used for message profiles
- Use: description of where and for what the algorithm is used
- Mandatory: an AlgorithmIdentifier which MUST be supported by conforming implementations
- Others: alternatives to the mandatory AlgorithmIdentifier
Name Use Mandatory Others
MSG_SIG_ALG Protection of PKI DSA/SHA-1 RSA/MD5...
messages using signature
MSG_MAC_ALG protection of PKI PasswordBasedMac HMAC,
messages using MACing X9.9...
SYM_PENC_ALG symmetric encryption of 3-DES (3-key- RC5,
an end entity's private EDE, CBC mode) CAST-128...
key where symmetric
key is distributed
out-of-band
PROT_ENC_ALG asymmetric algorithm D-H RSA
used for encryption of
(symmetric keys for
encryption of) private
keys transported in
PKIMessages
PROT_SYM_ALG symmetric encryption 3-DES (3-key- RC5,
algorithm used for EDE, CBC mode) CAST-128...
encryption of private
key bits (a key of this
type is encrypted using
PROT_ENC_ALG)
Mandatory AlgorithmIdentifiers and Specifications:
DSA/SHA-1:
AlgId: {1 2 840 10040 4 3};
NIST, FIPS PUB 186: Digital Signature Standard, 1994;
Public Modulus size: 1024 bits.
PasswordBasedMac:
{1 2 840 113533 7 66 13}, with SHA-1 {1 3 14 3 2 26} as the owf
parameter and HMAC-SHA1 {1 3 6 1 5 5 8 1 2} as the mac parameter;
(this specification), along with
NIST, FIPS PUB 180-1: Secure Hash Standard, April 1995;
H. Krawczyk, M. Bellare, R. Canetti, "HMAC: Keyed-Hashing for Message
Authentication", Internet Request for Comments 2104, February 1997.
3-DES:
{1 2 840 113549 3 7};
(used in RSA's BSAFE and in S/MIME).
D-H:
AlgId: {1 2 840 10046 2 1};
ANSI X9.42;
Public Modulus Size: 1024 bits.
DHParameter ::= SEQUENCE {
prime INTEGER, -- p
base INTEGER -- g
}
B3. "Self-signed" certificates ๐ช
This is the profile for how a Certificate structure can be "self-signed". These structures are used for distribution of "root" CA public keys, and it can happen in one of three ways (see Section 2.4 above for a description of the use of these structures) ๐ธ
Type Function
newWithNew a true "self-signed" certificate; the contained public
key MUST be usable to verify the signature (though this
provides only integrity and no authentication whatsoever)
oldWithNew previous root CA public key signed with new private key
newWithOld new root CA public key signed with previous private key
<<Such certificates (including relevant extensions) must contain "sensible" values for all fields. For example, when present subjectAltName MUST be identical to issuerAltName, and when present keyIdentifiers must contain appropriate values, et cetera.>>
B4. Proof of Possession Profile ๐
This is the POP fields profile for use in the signature field of the pop field of a ProofOfPossession structure. It covers proving possession of a private signing key that corresponds to a public verification key for which a certificate has been requested.
Field Value Comment
algorithmIdentifier MSG_SIG_ALG only signature protection is
allowed for this proof
signature present bits calculated using MSG_SIG_ALG
<<Proof of possession of a private decryption key which corresponds to a public encryption key for which a certificate has been requested does not use this profile; instead the method given in protectionAlg for PKIConfirm in Section B8 is used.>>
Not every CA/RA will do Proof-of-Possession (of signing key, decryption key, or key agreement key) in the PKIX-CMP in-band certification request protocol (how POP is done MAY ultimately be a policy issue which is made explicit for any given CA in its publicized Policy OID and Certification Practice Statement). However, this specification mandates that CA/RA entities MUST do POP (by some means) as part of the certification process. All end entities MUST be prepared to provide POP (i.e., these components of the PKIX-CMP protocol MUST be supported). no pressure, but POP is kind of a big deal ๐
B5. Root CA Key Update ๐
A root CA updates its key pair. It then produces a CA key update announcement message which can be made available (via one of the transport mechanisms) to the relevant end entities. A PKIConfirm message is NOT REQUIRED from the end entities. ๐ซถ
ckuann message:
Field Value Comment
sender CA name responding CA name
body ckuann(CAKeyUpdAnnContent)
oldWithNew present see Section B3 above
newWithOld present see Section B3 above
newWithNew present see Section B3 above
extraCerts optionally present can be used to "publish"
certificates (e.g.,
certificates signed using
the new private key)
B6. PKI Information request/response ๐ฌ
The end entity sends a general message to the PKI requesting details which will be required for later PKI management operations. The RA/CA responds with a general response. If an RA generates the response then it will simply forward the equivalent message which it previously received from the CA, with the possible addition of the certificates to the extraCerts fields of the PKIMessage. A PKIConfirm message is NOT REQUIRED from the end entity. ๐ง
Message Flows:
Step# End entity PKI
1 format genm
2 -> genm ->
3 handle genm
4 produce genp
5 <- genp <-
6 handle genp
genm:
Field Value
recipient CA name
-- the name of the CA as contained in issuerAltName extensions or
-- issuer fields within certificates
protectionAlg MSG_MAC_ALG or MSG_SIG_ALG
-- any authenticated protection alg.
SenderKID present if required
-- must be present if required for verification of message protection
freeText any valid value
body genr (GenReqContent)
GenMsgContent empty SEQUENCE
-- all relevant information requested
protection present
-- bits calculated using MSG_MAC_ALG or MSG_SIG_ALG
genp:
Field Value
sender CA name
-- name of the CA which produced the message
protectionAlg MSG_MAC_ALG or MSG_SIG_ALG
-- any authenticated protection alg.
senderKID present if required
-- must be present if required for verification of message protection
body genp (GenRepContent)
CAProtEncCert present (object identifier one
of PROT_ENC_ALG), with relevant
value
-- to be used if end entity needs to encrypt information for the CA
-- (e.g., private key for recovery purposes)
SignKeyPairTypes present, with relevant value
-- the set of signature algorithm identifiers which this CA will
-- certify for subject public keys
EncKeyPairTypes present, with relevant value
-- the set of encryption/key agreement algorithm identifiers which
-- this CA will certify for subject public keys
PreferredSymmAlg present (object identifier one
of PROT_SYM_ALG) , with relevant
value
-- the symmetric algorithm which this CA expects to be used in later
-- PKI messages (for encryption)
CAKeyUpdateInfo optionally present, with
relevant value
-- the CA MAY provide information about a relevant root CA key pair
-- using this field (note that this does not imply that the responding
-- CA is the root CA in question)
CurrentCRL optionally present, with relevant value
-- the CA MAY provide a copy of a complete CRL (i.e., fullest possible
-- one)
protection present
-- bits calculated using MSG_MAC_ALG or MSG_SIG_ALG
extraCerts optionally present
-- can be used to send some certificates to the end entity. An RA MAY
-- add its certificate here.
B7. Cross certification request/response (1-way) ๐ฆ
This covers creating a single cross-certificate (not two at once). The requesting CA MAY choose who is responsible for publication of the cross-certificate created by the responding CA, through use of the PKIPublicationInfo control.
Preconditions:
- Responding CA can verify the origin of the request (possibly requiring out-of-band means) before processing the request.
- Requesting CA can authenticate the authenticity of the origin of the response (possibly requiring out-of-band means) before processing the response
Message Flows:
Step# Requesting CA Responding CA
1 format ccr
2 -> ccr ->
3 handle ccr
4 produce ccp
5 <- ccp <-
6 handle ccp
7 format conf
8 -> conf ->
9 handle conf
ccr:
Field Value
sender Requesting CA name
-- the name of the CA who produced the message
recipient Responding CA name
-- the name of the CA who is being asked to produce a certificate
messageTime time of production of message
-- current time at requesting CA
protectionAlg MSG_SIG_ALG
-- only signature protection is allowed for this request
senderKID present if required
-- must be present if required for verification of message protection
transactionID present
-- implementation-specific value, meaningful to requesting CA.
-- [If already in use at responding CA then a rejection message
-- MUST be produced by responding CA]
senderNonce present
-- 128 (pseudo-)random bits
freeText any valid value
body ccr (CertReqMessages)
only one CertReqMsg
allowed
-- if multiple cross certificates are required they MUST be packaged
-- in separate PKIMessages
certTemplate present
-- details follow
version v1 or v3
-- <<v3 STRONGLY RECOMMENDED>>
signingAlg present
-- the requesting CA must know in advance with which algorithm it
-- wishes the certificate to be signed
subject present
-- may be NULL-DN only if subjectAltNames extension value proposed
validity present
-- MUST be completely specified (i.e., both fields present)
issuer present
-- may be NULL-DN only if issuerAltNames extension value proposed
publicKey present
-- the key to be certified (which must be for a signing algorithm)
extensions optionally present
-- a requesting CA must propose values for all extensions which it
-- requires to be in the cross-certificate
POPOSigningKey present
-- see "Proof of possession profile" (Section B4)
protection present
-- bits calculated using MSG_SIG_ALG
extraCerts optionally present
-- MAY contain any additional certificates that requester wishes
-- to include
ccp:
Field Value
sender Responding CA name
-- the name of the CA who produced the message
recipient Requesting CA name
-- the name of the CA who asked for production of a certificate
messageTime time of production of message
-- current time at responding CA
protectionAlg MSG_SIG_ALG
-- only signature protection is allowed for this message
senderKID present if required
-- must be present if required for verification of message
-- protection
recipKID present if required
transactionID present
-- value from corresponding ccr message
senderNonce present
-- 128 (pseudo-)random bits
recipNonce present
-- senderNonce from corresponding ccr message
freeText any valid value
body ccp (CertRepMessage)
only one CertResponse allowed
-- if multiple cross certificates are required they MUST be packaged
-- in separate PKIMessages
response present
status present
PKIStatusInfo.status present
-- if PKIStatusInfo.status is one of:
-- granted, or
-- grantedWithMods,
-- then certifiedKeyPair MUST be present and failInfo MUST be absent
failInfo present depending on
PKIStatusInfo.status
-- if PKIStatusInfo.status is:
-- rejection
-- then certifiedKeyPair MUST be absent and failInfo MUST be present
-- and contain appropriate bit settings
certifiedKeyPair present depending on
PKIStatusInfo.status
certificate present depending on
certifiedKeyPair
-- content of actual certificate must be examined by requesting CA
-- before publication
protection present
-- bits calculated using MSG_SIG_ALG
extraCerts optionally present
-- MAY contain any additional certificates that responder wishes
-- to include
B8. Initial Registration/Certification (Basic Authenticated Scheme) ๐
Okay so picture this: an uninitialized end entity ๐ง wants its very first certificate from a CA. The CA replies with a message containing that certificate, and then the end entity sends back a confirmation. And literally every message in this scheme is authenticated ๐, no cap.
This scheme lets the end entity ask for certification of a key it generated locally (usually a signature key โ๏ธ). The end entity MAY also choose to request centralized generation and certification of another key pair (usually an encryption key pair) ๐.
Certification can only be requested for one locally generated public key. If you need more, you send separate PKIMessages ๐จ.
The end entity MUST support proof-of-possession of the private key associated with the locally-generated public key. This is non-negotiable bestie ๐ .
Preconditions:
- 1. The end entity can authenticate the CA's signature based on out-of-band means
- 2. The end entity and the CA share a symmetric MACing key
Message flow:
Step# End entity PKI
1 format ir
2 -> ir ->
3 handle ir
4 format ip
5 <- ip <-
6 handle ip
7 format conf
8 -> conf ->
9 handle conf
For this profile, we mandate that the end entity MUST include all (i.e., one or two) CertReqMsg in a single PKIMessage, and that the PKI (CA) MUST produce a single response PKIMessage which contains the complete response (i.e., including the OPTIONAL second key pair, if it was requested and if centralized key generation is supported). For simplicity, we also mandate that this message MUST be the final one (i.e., no use of "waiting" status value). It's giving streamlined โจ.
ir:
Field Value
recipient CA name
-- the name of the CA who is being asked to produce a certificate
protectionAlg MSG_MAC_ALG
-- only MAC protection is allowed for this request, based on
-- initial authentication key
senderKID referenceNum
-- the reference number which the CA has previously issued to
-- the end entity (together with the MACing key)
transactionID present
-- implementation-specific value, meaningful to end entity.
-- [If already in use at the CA then a rejection message MUST be
-- produced by the CA]
senderNonce present
-- 128 (pseudo-)random bits
freeText any valid value
body ir (CertReqMessages)
only one or two CertReqMsg
are allowed
-- if more certificates are required requests MUST be packaged in
-- separate PKIMessages
CertReqMsg one or two present
-- see below for details, note: crm[0] means the first (which MUST
-- be present), crm[1] means the second (which is OPTIONAL, and used
-- to ask for a centrally-generated key)
crm[0].certReq. fixed value of zero
certReqId
-- this is the index of the template within the message
crm[0].certReq present
certTemplate
-- MUST include subject public key value, otherwise unconstrained
crm[0].pop... optionally present if public key
POPOSigningKey from crm[0].certReq.certTemplate is
a signing key
-- proof of possession MAY be required in this exchange (see Section
-- B4 for details)
crm[0].certReq. optionally present
controls.archiveOptions
-- the end entity MAY request that the locally-generated private key
-- be archived
crm[0].certReq. optionally present
controls.publicationInfo
-- the end entity MAY ask for publication of resulting cert.
crm[1].certReq fixed value of one
certReqId
-- the index of the template within the message
crm[1].certReq present
certTemplate
-- MUST NOT include actual public key bits, otherwise unconstrained
-- (e.g., the names need not be the same as in crm[0])
crm[0].certReq. present [object identifier MUST be PROT_ENC_ALG]
controls.protocolEncKey
-- if centralized key generation is supported by this CA, this
-- short-term asymmetric encryption key (generated by the end entity)
-- will be used by the CA to encrypt (a symmetric key used to encrypt)
-- a private key generated by the CA on behalf of the end entity
crm[1].certReq. optionally present
controls.archiveOptions
crm[1].certReq. optionally present
controls.publicationInfo
protection present
-- bits calculated using MSG_MAC_ALG
ip: ๐โจ okay so this is the CA's reply to your ir, the ip (initialization response), and it's giving very organized energy. Let's go row by row, bestie ๐
Field Value
sender CA name
-- the name of the CA who produced the message
messageTime present
-- time at which CA produced message
protectionAlg MS_MAC_ALG
-- only MAC protection is allowed for this response
recipKID referenceNum
-- the reference number which the CA has previously issued to the
-- end entity (together with the MACing key)
transactionID present
-- value from corresponding ir message
senderNonce present
-- 128 (pseudo-)random bits
recipNonce present
-- value from senderNonce in corresponding ir message
freeText any valid value
body ir (CertRepMessage)
contains exactly one response
for each request
-- The PKI (CA) responds to either one or two requests as appropriate.
-- crc[0] denotes the first (always present); crc[1] denotes the
-- second (only present if the ir message contained two requests and
-- if the CA supports centralized key generation).
crc[0]. fixed value of zero
certReqId
-- MUST contain the response to the first request in the corresponding
-- ir message
crc[0].status. present, positive values allowed:
status "granted", "grantedWithMods"
negative values allowed:
"rejection"
crc[0].status. present if and only if
failInfo crc[0].status.status is "rejection"
crc[0]. present if and only if
certifiedKeyPair crc[0].status.status is
"granted" or "grantedWithMods"
certificate present unless end entity's public
key is an encryption key and POP
is done in this in-band exchange
encryptedCert present if and only if end entity's
public key is an encryption key and
POP done in this in-band exchange
publicationInfo optionally present
-- indicates where certificate has been published (present at
-- discretion of CA)
crc[1]. fixed value of one
certReqId
-- MUST contain the response to the second request in the
-- corresponding ir message
crc[1].status. present, positive values allowed:
status "granted", "grantedWithMods"
negative values allowed:
"rejection"
crc[1].status. present if and only if
failInfo crc[0].status.status is "rejection"
crc[1]. present if and only if
certifiedKeyPair crc[0].status.status is "granted"
or "grantedWithMods"
certificate present
privateKey present
publicationInfo optionally present
-- indicates where certificate has been published (present at
-- discretion of CA)
protection present
-- bits calculated using MSG_MAC_ALG
extraCerts optionally present
-- the CA MAY provide additional certificates to the end entity
conf: ๐ซถ and then the end entity closes the loop with a conf (confirmation). The CA's name goes in the recipient field, and the MAC key depends on whether POP happened in this exchange, so pay attention to that part. ๐
Field Value
recipient CA name
-- the name of the CA who was asked to produce a certificate
transactionID present
-- value from corresponding ir and ip messages
senderNonce present
-- value from recipNonce in corresponding ip message
recipNonce present
-- value from senderNonce in corresponding ip message
protectionAlg MSG_MAC_ALG
-- only MAC protection is allowed for this message. The MAC is
-- based on the initial authentication key if only a signing key
-- pair has been sent in ir for certification, or if POP is not
-- done in this in-band exchange. Otherwise, the MAC is based on
-- a key derived from the symmetric key used to decrypt the
-- returned encryptedCert.
senderKID referenceNum
-- the reference number which the CA has previously issued to the
-- end entity (together with the MACing key)
body conf (PKIConfirmContent)
-- this is an ASN.1 NULL
protection present
-- bits calculated using MSG_MAC_ALG
B9. Certificate Request ๐โจ
An end entity that's been initialized can ask a CA for a certificate, for any reason at all ๐ When the CA sends back a message with a certificate in it, the end entity replies with a confirmation. Every message in this exchange gets authenticated, so no sneaking around ๐
This one follows the B8 profile, with a few tweaks:
- protectionAlg may be MSG_MAC_ALG or MSG_SIG_ALG in request, response, and confirm messages (the determination in the confirm message being dependent upon POP considerations for key-encipherment and key-agreement certificate requests);
- senderKID and recipKID are only present if required for message verification;
- body is cr or cp;
- protocolEncKey is not present;
- protection bits are calculated according to the protectionAlg field.
B10. Key Update Request ๐๐
Same vibe here, except this end entity already has a key pair and certificate, and it wants a fresh certificate to update them ๐ธ Again, the CA answers with a certificate, the end entity confirms, and every message is authenticated.
The profile is B8 again, with these exceptions:
- protectionAlg may be MSG_MAC_ALG or MSG_SIG_ALG in request, response, and confirm messages (the determination in the confirm message being dependent upon POP considerations for key-encipherment and key-agreement certificate requests);
- senderKID and recipKID are only present if required for message verification;
- body is kur or kup;
- protection bits are calculated according to the protectionAlg field.
Appendix C: "Compilable" ASN.1 Module using 1988 Syntax ๐ง๐
Last but not least, the whole module, ready to compile. It's a lot, but it's the official source of truth for every field we just went through ๐ฆ
PKIXCMP {iso(1) identified-organization(3) dod(6) internet(1)
security(5) mechanisms(5) pkix(7) id-mod(0) id-mod-cmp(9)}
DEFINITIONS EXPLICIT TAGS ::=
BEGIN
-- EXPORTS ALL --
IMPORTS
Certificate, CertificateList, Extensions, AlgorithmIdentifier
FROM PKIX1Explicit88 {iso(1) identified-organization(3)
dod(6) internet(1) security(5) mechanisms(5) pkix(7)
id-mod(0) id-pkix1-explicit-88(1)}}
GeneralName, KeyIdentifier, ReasonFlags
FROM PKIX1Implicit88 {iso(1) identified-organization(3)
dod(6) internet(1) security(5) mechanisms(5) pkix(7)
id-mod(0) id-pkix1-implicit-88(2)}
CertTemplate, PKIPublicationInfo, EncryptedValue, CertId,
CertReqMessages
FROM PKIXCRMF {iso(1) identified-organization(3)
dod(6) internet(1) security(5) mechanisms(5) pkix(7)
id-mod(0) id-mod-crmf(5)}}
-- CertificationRequest
-- FROM PKCS10 {no standard ASN.1 module defined;
-- implementers need to create their own module to import
-- from, or directly include the PKCS10 syntax in this module}
-- Locally defined OIDs --
PKIMessage ::= SEQUENCE {
header PKIHeader,
body PKIBody,
protection [0] PKIProtection OPTIONAL,
extraCerts [1] SEQUENCE SIZE (1..MAX) OF Certificate OPTIONAL
}
PKIHeader ::= SEQUENCE {
pvno INTEGER { ietf-version2 (1) },
sender GeneralName,
-- identifies the sender
recipient GeneralName,
-- identifies the intended recipient
messageTime [0] GeneralizedTime OPTIONAL,
-- time of production of this message (used when sender
-- believes that the transport will be "suitable"; i.e.,
-- that the time will still be meaningful upon receipt)
protectionAlg [1] AlgorithmIdentifier OPTIONAL,
-- algorithm used for calculation of protection bits
senderKID [2] KeyIdentifier OPTIONAL,
recipKID [3] KeyIdentifier OPTIONAL,
-- to identify specific keys used for protection
transactionID [4] OCTET STRING OPTIONAL,
-- identifies the transaction; i.e., this will be the same in
-- corresponding request, response and confirmation messages
senderNonce [5] OCTET STRING OPTIONAL,
recipNonce [6] OCTET STRING OPTIONAL,
-- nonces used to provide replay protection, senderNonce
-- is inserted by the creator of this message; recipNonce
-- is a nonce previously inserted in a related message by
-- the intended recipient of this message
freeText [7] PKIFreeText OPTIONAL,
-- this may be used to indicate context-specific instructions
-- (this field is intended for human consumption)
generalInfo [8] SEQUENCE SIZE (1..MAX) OF
InfoTypeAndValue OPTIONAL
-- this may be used to convey context-specific information
-- (this field not primarily intended for human consumption)
}
PKIFreeText ::= SEQUENCE SIZE (1..MAX) OF UTF8String
-- text encoded as UTF-8 String (note: each UTF8String SHOULD
-- include an RFC 1766 language tag to indicate the language
-- of the contained text)
PKIBody ::= CHOICE { -- message-specific body elements
ir [0] CertReqMessages, --Initialization Request
ip [1] CertRepMessage, --Initialization Response
cr [2] CertReqMessages, --Certification Request
cp [3] CertRepMessage, --Certification Response
p10cr [4] CertificationRequest, --imported from [PKCS10]
popdecc [5] POPODecKeyChallContent, --pop Challenge
popdecr [6] POPODecKeyRespContent, --pop Response
kur [7] CertReqMessages, --Key Update Request
kup [8] CertRepMessage, --Key Update Response
krr [9] CertReqMessages, --Key Recovery Request
krp [10] KeyRecRepContent, --Key Recovery Response
rr [11] RevReqContent, --Revocation Request
rp [12] RevRepContent, --Revocation Response
ccr [13] CertReqMessages, --Cross-Cert. Request
ccp [14] CertRepMessage, --Cross-Cert. Response
ckuann [15] CAKeyUpdAnnContent, --CA Key Update Ann.
cann [16] CertAnnContent, --Certificate Ann.
rann [17] RevAnnContent, --Revocation Ann.
crlann [18] CRLAnnContent, --CRL Announcement
conf [19] PKIConfirmContent, --Confirmation
nested [20] NestedMessageContent, --Nested Message
genm [21] GenMsgContent, --General Message
genp [22] GenRepContent, --General Response
error [23] ErrorMsgContent --Error Message
}
PKIProtection ::= BIT STRING
ProtectedPart ::= SEQUENCE {
header PKIHeader,
body PKIBody
}
PasswordBasedMac ::= OBJECT IDENTIFIER --{1 2 840 113533 7 66 13}
PBMParameter ::= SEQUENCE {
salt OCTET STRING,
owf AlgorithmIdentifier,
-- AlgId for a One-Way Function (SHA-1 recommended)
iterationCount INTEGER,
-- number of times the OWF is applied
mac AlgorithmIdentifier
-- the MAC AlgId (e.g., DES-MAC, Triple-DES-MAC [PKCS11],
} -- or HMAC [RFC2104, RFC2202])
DHBasedMac ::= OBJECT IDENTIFIER --{1 2 840 113533 7 66 30}
DHBMParameter ::= SEQUENCE {
owf AlgorithmIdentifier,
-- AlgId for a One-Way Function (SHA-1 recommended)
mac AlgorithmIdentifier
-- the MAC AlgId (e.g., DES-MAC, Triple-DES-MAC [PKCS11],
} -- or HMAC [RFC2104, RFC2202])
NestedMessageContent ::= PKIMessage
okay so the module keeps going with the actual message bodies, and this is where the good stuff lives ๐ โจ
PKIStatus ::= INTEGER {
granted (0),
-- you got exactly what you asked for
grantedWithMods (1),
-- you got something like what you asked for; the
-- requester is responsible for ascertaining the differences
rejection (2),
-- you don't get it, more information elsewhere in the message
waiting (3),
-- the request body part has not yet been processed,
-- expect to hear more later
revocationWarning (4),
-- this message contains a warning that a revocation is
-- imminent
revocationNotification (5),
-- notification that a revocation has occurred
keyUpdateWarning (6)
-- update already done for the oldCertId specified in
-- CertReqMsg
}
PKIFailureInfo ::= BIT STRING {
-- since we can fail in more than one way!
-- More codes may be added in the future if/when required.
badAlg (0),
-- unrecognized or unsupported Algorithm Identifier
badMessageCheck (1),
-- integrity check failed (e.g., signature did not verify)
badRequest (2),
-- transaction not permitted or supported
badTime (3),
-- messageTime was not sufficiently close to the system time,
-- as defined by local policy
badCertId (4),
-- no certificate could be found matching the provided criteria
badDataFormat (5),
-- the data submitted has the wrong format
wrongAuthority (6),
-- the authority indicated in the request is different from the
-- one creating the response token
incorrectData (7),
-- the requester's data is incorrect (for notary services)
missingTimeStamp (8),
-- when the timestamp is missing but should be there (by policy)
badPOP (9)
-- the proof-of-possession failed
}
PKIStatusInfo ::= SEQUENCE {
status PKIStatus,
statusString PKIFreeText OPTIONAL,
failInfo PKIFailureInfo OPTIONAL
}
OOBCert ::= Certificate
OOBCertHash ::= SEQUENCE {
hashAlg [0] AlgorithmIdentifier OPTIONAL,
certId [1] CertId OPTIONAL,
hashVal BIT STRING
-- hashVal is calculated over DER encoding of the
-- subjectPublicKey field of the corresponding cert.
}
POPODecKeyChallContent ::= SEQUENCE OF Challenge
-- One Challenge per encryption key certification request (in the
-- same order as these requests appear in CertReqMessages).
Challenge ::= SEQUENCE {
owf AlgorithmIdentifier OPTIONAL,
-- MUST be present in the first Challenge; MAY be omitted in any
-- subsequent Challenge in POPODecKeyChallContent (if omitted,
-- then the owf used in the immediately preceding Challenge is
-- to be used).
witness OCTET STRING,
-- the result of applying the one-way function (owf) to a
-- randomly-generated INTEGER, A. [Note that a different
-- INTEGER MUST be used for each Challenge.]
challenge OCTET STRING
-- the encryption (under the public key for which the cert.
-- request is being made) of Rand, where Rand is specified as
-- Rand ::= SEQUENCE {
-- int INTEGER,
-- - the randomly-generated INTEGER A (above)
-- sender GeneralName
-- - the sender's name (as included in PKIHeader)
-- }
}
POPODecKeyRespContent ::= SEQUENCE OF INTEGER
-- One INTEGER per encryption key certification request (in the
-- same order as these requests appear in CertReqMessages). The
-- retrieved INTEGER A (above) is returned to the sender of the
-- corresponding Challenge.
CertRepMessage ::= SEQUENCE {
caPubs [1] SEQUENCE SIZE (1..MAX) OF Certificate OPTIONAL,
response SEQUENCE OF CertResponse
}
CertResponse ::= SEQUENCE {
certReqId INTEGER,
-- to match this response with corresponding request (a value
-- of -1 is to be used if certReqId is not specified in the
-- corresponding request)
status PKIStatusInfo,
certifiedKeyPair CertifiedKeyPair OPTIONAL,
rspInfo OCTET STRING OPTIONAL
-- analogous to the id-regInfo-asciiPairs OCTET STRING defined
-- for regInfo in CertReqMsg [CRMF]
}
CertifiedKeyPair ::= SEQUENCE {
certOrEncCert CertOrEncCert,
privateKey [0] EncryptedValue OPTIONAL,
publicationInfo [1] PKIPublicationInfo OPTIONAL
}
CertOrEncCert ::= CHOICE {
certificate [0] Certificate,
encryptedCert [1] EncryptedValue
}
KeyRecRepContent ::= SEQUENCE {
status PKIStatusInfo,
newSigCert [0] Certificate OPTIONAL,
caCerts [1] SEQUENCE SIZE (1..MAX) OF
Certificate OPTIONAL,
keyPairHist [2] SEQUENCE SIZE (1..MAX) OF
CertifiedKeyPair OPTIONAL
}
RevReqContent ::= SEQUENCE OF RevDetails
RevDetails ::= SEQUENCE {
certDetails CertTemplate,
-- allows requester to specify as much as they can about
-- the cert. for which revocation is requested
-- (e.g., for cases in which serialNumber is not available)
revocationReason ReasonFlags OPTIONAL,
-- the reason that revocation is requested
badSinceDate GeneralizedTime OPTIONAL,
-- indicates best knowledge of sender
crlEntryDetails Extensions OPTIONAL
-- requested crlEntryExtensions
}
RevRepContent ::= SEQUENCE {
status SEQUENCE SIZE (1..MAX) OF PKIStatusInfo,
-- in same order as was sent in RevReqContent
revCerts [0] SEQUENCE SIZE (1..MAX) OF CertId OPTIONAL,
-- IDs for which revocation was requested (same order as status)
crls [1] SEQUENCE SIZE (1..MAX) OF CertificateList OPTIONAL
-- the resulting CRLs (there may be more than one)
}
CAKeyUpdAnnContent ::= SEQUENCE {
oldWithNew Certificate, -- old pub signed with new priv
newWithOld Certificate, -- new pub signed with old priv
newWithNew Certificate -- new pub signed with new priv
}
CertAnnContent ::= Certificate
RevAnnContent ::= SEQUENCE {
status PKIStatus,
certId CertId,
willBeRevokedAt GeneralizedTime,
badSinceDate GeneralizedTime,
crlDetails Extensions OPTIONAL
-- extra CRL details(e.g., crl number, reason, location, etc.)
}
CRLAnnContent ::= SEQUENCE OF CertificateList
PKIConfirmContent ::= NULL
InfoTypeAndValue ::= SEQUENCE {
infoType OBJECT IDENTIFIER,
infoValue ANY DEFINED BY infoType OPTIONAL
}
-- Example InfoTypeAndValue contents include, but are not limited to:
-- { CAProtEncCert = {id-it 1}, Certificate }
-- { SignKeyPairTypes = {id-it 2}, SEQUENCE OF AlgorithmIdentifier }
-- { EncKeyPairTypes = {id-it 3}, SEQUENCE OF AlgorithmIdentifier }
-- { PreferredSymmAlg = {id-it 4}, AlgorithmIdentifier }
-- { CAKeyUpdateInfo = {id-it 5}, CAKeyUpdAnnContent }
-- { CurrentCRL = {id-it 6}, CertificateList }
-- where {id-it} = {id-pkix 4} = {1 3 6 1 5 5 7 4}
-- This construct MAY also be used to define new PKIX Certificate
-- Management Protocol request and response messages, or general-
-- purpose (e.g., announcement) messages for future needs or for
-- specific environments.
GenMsgContent ::= SEQUENCE OF InfoTypeAndValue
-- May be sent by EE, RA, or CA (depending on message content).
-- The OPTIONAL infoValue parameter of InfoTypeAndValue will typically
-- be omitted for some of the examples given above. The receiver is
-- free to ignore any contained OBJ. IDs that it does not recognize.
-- If sent from EE to CA, the empty set indicates that the CA may send
-- any/all information that it wishes.
GenRepContent ::= SEQUENCE OF InfoTypeAndValue
-- The receiver is free to ignore any contained OBJ. IDs that it does
-- not recognize.
ErrorMsgContent ::= SEQUENCE {
pKIStatusInfo PKIStatusInfo,
errorCode INTEGER OPTIONAL,
-- implementation-specific error codes
errorDetails PKIFreeText OPTIONAL
-- implementation-specific error details
}
-- The following definition is provided for compatibility reasons with
-- 1988 and 1993 ASN.1 compilers which allow the use of UNIVERSAL class
-- tags (not a part of formal ASN.1); 1997 and subsequent compilers
-- SHOULD comment out this line.
UTF8String ::= [UNIVERSAL 12] IMPLICIT OCTET STRING
END
Appendix D: Registration of MIME Type for Section 5 ๐
ok so this last bit is the MIME registration form, basically the paperwork that tells everyone what the application/pkixcmp type is all about ๐๐ธ the vibe is very "filling out a form but make it iconic" ๐
To: ietf-types@iana.org
Subject: Registration of MIME media type application/pkixcmp
MIME media type name: application
MIME subtype name: pkixcmp
Required parameters: -
Optional parameters: -
Encoding considerations:
Content may contain arbitrary octet values (the ASN.1 DER encoding of
a PKI message, as defined in the IETF PKIX Working Group
specifications). base64 encoding is required for MIME e-mail; no
encoding is necessary for HTTP.
Security considerations:
This MIME type may be used to transport Public-Key Infrastructure
(PKI) messages between PKI entities. These messages are defined by
the IETF PKIX Working Group and are used to establish and maintain an
Internet X.509 PKI. There is no requirement for specific security
mechanisms to be applied at this level if the PKI messages themselves
are protected as defined in the PKIX specifications.
Interoperability considerations: -
Published specification: this document
Applications which use this media type:
Applications using certificate management, operational, or ancillary
protocols (as defined by the IETF PKIX Working Group) to send PKI
messages via E-Mail or HTTP.
Additional information:
Magic number (s): -
File extension (s): ".PKI"
Macintosh File Type Code (s): -
Person and email address to contact for further information:
Carlisle Adams, cadams@entrust.com
Intended usage: COMMON
Author/Change controller: Carlisle Adams
Full Copyright Statement ๐
okay bestie, last stop, the legal bits ๐ Copyright (C) The Internet Society (1999). All Rights Reserved. ๐
So here's the deal. You're totally allowed to copy this document and pass it around to your friends ๐. You can also make derivative works that comment on it, explain it, or help people actually implement it, and you can publish and distribute those too, in whole or in part, with no restrictions of any kind โจ. The one condition is that the copyright notice and this paragraph have to be included on every single copy and derivative work ๐ซถ.
BUT the original document itself can't be changed in any way ๐ โโ๏ธ. You can't remove the copyright notice or the references to the Internet Society or other Internet organizations. The exceptions are if you need it for developing Internet standards, in which case you have to follow the copyright procedures in the Internet Standards process ๐, or if you're translating it into a language other than English ๐.
Heads up: the permissions above are perpetual, meaning they will never be revoked by the Internet Society or its successors or assigns ๐.
And the disclaimer, which is the serious part ๐ญ. This document and all the information in it are provided "AS IS". The Internet Society and the Internet Engineering Task Force totally disclaim all warranties, express or implied ๐. That includes, but isn't limited to, any warranty that using the information won't infringe any rights, and any implied warranties of merchantability or fitness for a particular purpose ๐.
Okay that's the whole document, the end ๐ฆโจ
๐ฆ where this page comes from
- ietf: rfc2510 1999-03
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms