A CMP transaction consists of exchanging PKIMessages [
RFC 4210] between PKI end entities (EEs), registration authorities (RAs), and certification authorities (CAs). If the EEs are constrained devices, then they may prefer, as a CMP client, the use of CoAP instead of HTTP as the transfer mechanism. In general, the RAs and CAs are not constrained and can support both CoAP and HTTP client and server implementations. This section specifies how to use CoAP as the transfer mechanism for CMP.
The CoAP URI format is described in
Section 6 of
RFC 7252. The CoAP endpoints
MUST support use of the path prefix "/.well-known/" as defined in [
RFC 8615] and the registered name "cmp" to help with endpoint discovery and interoperability. Optional path segments
MAY be added after the registered application name (i.e., after "/.well-known/cmp") to provide distinction. The path segment 'p' followed by an arbitraryLabel <name> could, for example, support the differentiation of specific CAs or certificate profiles. Further path segments, for example, as specified in [
RFC 9483], could indicate PKI management operations using an operationLabel <operation>. A valid full CMP URI can look like this:
coap://www.example.com/.well-known/cmp
coap://www.example.com/.well-known/cmp/<operation>
coap://www.example.com/.well-known/cmp/p/<profileLabel>
coap://www.example.com/.well-known/cmp/p/<profileLabel>/<operation>
The EEs can be configured with enough information to form the CMP server URI. The minimum information that can be configured is the scheme, i.e., "coap:" or "coaps:", and the authority portion of the URI, e.g., "example.com:5683". If the port number is not specified in the authority, then the default port numbers
MUST be assumed for the "coap:" and "coaps:" scheme URIs. The default port for "coap:" scheme URIs is 5683 and the default port for "coaps:" scheme URIs is 5684 [
RFC 7252].
Optionally, in the environments where a Local RA or CA is deployed, EEs can also use the CoAP service discovery mechanism [
RFC 7252] to discover the URI of the Local RA or CA. The CoAP CMP endpoints supporting service discovery
MUST also support resource discovery in the Constrained RESTful Environments (CoRE) Link Format, as described in [
RFC 6690]. The link
MUST include the 'ct' attribute defined in
Section 7.2.1 of
RFC 7252 with the value of "application/pkixcmp", as defined in the "CoAP Content-Formats" IANA registry.
The CMP PKIMessages
MUST be DER encoded and sent as the body of the CoAP POST request. A CMP client
MUST send each CoAP request marked as a Confirmable message [
RFC 7252]. If the CoAP request is successful, then the CMP RA or CA
MUST return a Success 2.xx response code; otherwise, the CMP RA or CA
MUST return an appropriate Client Error 4.xx or Server Error 5.xx response code. A CMP RA or CA may choose to send a piggybacked response [
RFC 7252] to the client, or it
MAY send a separate response [
RFC 7252] in case it takes some time for the RA or CA to process the CMP transaction.
When transferring CMP PKIMessage over CoAP, the content-format "application/pkixcmp"
MUST be used.
A CMP PKIMessage consists of a header, body, protection, and extraCerts structure, which may contain many optional and potentially large fields. Thus, a CMP message can be much larger than the Maximum Transmission Unit (MTU) of the outgoing interface of the device. The EEs and RAs or CAs
MUST use the block-wise transfer mode [
RFC 7959] to transfer such large messages instead of relying on IP fragmentation.
If a CoAP-to-HTTP proxy is in the path between EEs and an RA or EEs and a CA and if the server supports, then it
MUST use the chunked transfer encoding [
RFC 9112] to send data over the HTTP transport. The proxy
MUST try to reduce the number of packets sent by using an optimal chunk length for the HTTP transport.
CMP PKIMessages sent over CoAP
MUST NOT use a Multicast destination address.
A CMP server may publish announcements that can be triggered by an event or periodically for the other PKI entities. Here is the list of CMP announcement messages prefixed by their respective ASN.1 identifier (see
Section 5.1.2 of
RFC 4210):
[15] CA Key Update Announcement
[16] Certificate Announcement
[17] Revocation Announcement
[18] CRL Announcement
An EE
MAY use the CoAP Observe Option [
RFC 7641] to register itself to get any announcement messages from the RA or CA. The EE can send a GET request to the server's URI suffixed by "/ann". For example, a path to register for announcement messages may look like this:
coap://www.example.com/.well-known/cmp/ann
coap://www.example.com/.well-known/cmp/p/<profileLabel>/ann
If the server supports CMP announcement messages, then it
MUST send an appropriate Success 2.xx response code; otherwise, it
MUST send an appropriate Client Error 4.xx or Server Error 5.xx response code. If for some reason the server cannot add the client to its list of observers for the announcements, it can omit the Observe Option [
RFC 7641] in the response to the client. Upon receiving a Success 2.xx response without the Observe Option [
RFC 7641], after some time, a client
MAY try to register again for announcements from the CMP server. Since a server can remove the EE from the list of observers for announcement messages, an EE
SHOULD periodically reregister itself for announcement messages.
Alternatively, an EE
MAY periodically poll for the current status of the CA via the "PKI Information Request" message; see
Section 6.5 of
RFC 4210. If supported, EEs
MAY also use "support messages" defined in
Section 4.3 of
RFC 9483 to get information about the CA status. These mechanisms will help constrained devices that are acting as EEs to conserve resources by eliminating the need to create an endpoint for receiving notifications from the RA or CA. It will also simplify the implementation of a CoAP-to-HTTP proxy.