Text Encodings of PKIX and CMS

Similar documents
Category: Informational January 2010 ISSN:

Internet Engineering Task Force (IETF) Request for Comments: 5959 Category: Standards Track August 2010 ISSN:

Category: Informational June 2018 ISSN: The PKCS #8 EncryptedPrivateKeyInfo Media Type

Internet Engineering Task Force (IETF) Request for Comments: 6032 Category: Standards Track. December 2010

Internet Engineering Task Force (IETF) Obsoletes: 6485 Category: Standards Track August 2016 ISSN:

Internet Engineering Task Force (IETF) Request for Comments: 6490 Category: Standards Track. G. Michaelson APNIC. S. Kent BBN February 2012

Internet Engineering Task Force (IETF) Request for Comments: 7192 Category: Standards Track April 2014 ISSN:

Internet Engineering Task Force (IETF) Request for Comments: 6160 Category: Standards Track April 2011 ISSN:

Internet Engineering Task Force (IETF) Request for Comments: 8142 Category: Standards Track April 2017 ISSN:

Request for Comments: 3548 July 2003 Category: Informational

Internet Engineering Task Force (IETF) Category: Standards Track October 2015 ISSN:

Internet Engineering Task Force (IETF) Request for Comments: 6961 June 2013 Category: Standards Track ISSN:

Internet Engineering Task Force (IETF) Request for Comments: 5754 Updates: 3370 January 2010 Category: Standards Track ISSN:

Internet Engineering Task Force (IETF) Request for Comments: Category: Standards Track ISSN: July 2014

Internet Engineering Task Force (IETF) Category: Standards Track. June 2016

Internet Engineering Task Force (IETF) Request for Comments: 7193 Category: Informational. J. Schaad Soaring Hawk Consulting April 2014

Internet Engineering Task Force (IETF) Request for Comments: ISSN: May Internationalized Addresses in X.

Request for Comments: 8479 Category: Informational September 2018 ISSN:

Intended Category: Standards Track Expires March 2006 September 2005

Expires October 2005 Updates RFC 3280 April 2005

Internet Engineering Task Force (IETF) Updates: 5485 March 2018 Category: Informational ISSN:

Internet Engineering Task Force (IETF) Request for Comments: 5917 Category: Informational June 2010 ISSN:

Internet Engineering Task Force (IETF) Request for Comments: Category: Informational ISSN: March 2011

Internet Engineering Task Force (IETF) Request for Comments: 6818 Updates: 5280 January 2013 Category: Standards Track ISSN:

Intended Category: Standards Track Expires July 2006 January 2006

Internet Engineering Task Force (IETF) Symantec Corp. L. Rosenthol Adobe May Internet X.509 Public Key Infrastructure -- Certificate Image

Internet Engineering Task Force (IETF) Category: Standards Track Queensland University of Technology March 2011

Request for Comments: TIS Labs March Storing Certificates in the Domain Name System (DNS)

Internet Engineering Task Force (IETF) Category: Standards Track. March 2017

Internet-Draft November 12, 2005 Obsoletes: 3548 (if approved) Expires: May 16, 2006

Internet Engineering Task Force (IETF) Category: Standards Track March 2015 ISSN:

Internet Engineering Task Force (IETF) Updates: 5280 May 2018 Category: Standards Track ISSN:

Internet Engineering Task Force (IETF) Request for Comments: 8336 Category: Standards Track. March 2018

Internet Engineering Task Force (IETF) Request for Comments: 5756

Internet Engineering Task Force (IETF) Request for Comments: ISSN: November 2013

Internet Engineering Task Force (IETF) Category: Informational. August Using Trust Anchor Constraints during Certification Path Processing

Internet Engineering Task Force (IETF) Obsoletes: 4049 September 2010 Category: Standards Track ISSN:

Internet Engineering Task Force (IETF) Category: Standards Track ISSN: January 2015

October 4, 2000 Expires in six months. SMTP Service Extension for Secure SMTP over TLS. Status of this Memo

Internet Engineering Task Force (IETF) Category: Standards Track August 2018 ISSN:

Internet Engineering Task Force (IETF) Request for Comments: Category: Standards Track. BBN September 2017

Internet Engineering Task Force (IETF) Category: Informational October 2013 ISSN:

Internet Engineering Task Force (IETF) Request for Comments: 5987 Category: Standards Track August 2010 ISSN:

Internet Engineering Task Force (IETF) Category: Standards Track ISSN: L. Zhu Microsoft Corporation July 2010

Internet Engineering Task Force (IETF) Category: Experimental Helsinki Institute for Information Technology ISSN: May 2011

Internet Engineering Task Force (IETF) Request for Comments: 6403 Category: Informational ISSN: M. Peck November 2011

Internet Engineering Task Force (IETF) Request for Comments: August 2011

Network Working Group. Updates: 6376 (if approved) June 21, 2018 Intended status: Standards Track Expires: December 23, 2018

Internet Engineering Task Force (IETF) Category: Standards Track ISSN: January 2010

PKCS #10 v1.7: Certification Request Syntax Standard (Final draft)

Internet Engineering Task Force (IETF) April 2012

Request for Comments: 5402 Category: Informational February 2010 ISSN:

Internet Engineering Task Force (IETF) Obsoletes: 2831 July 2011 Category: Informational ISSN:

Internet Engineering Task Force (IETF) Updates: 6376 January 2018 Category: Standards Track ISSN:

Internet Engineering Task Force (IETF) Request for Comments: 7817 Updates: 2595, 3207, 3501, 5804 March 2016 Category: Standards Track ISSN:

Request for Comments: J. Salowey, Ed. Cisco Systems, Inc. March Transport Layer Security (TLS) Transport Mapping for Syslog

Request for Comments: 7259 Category: Informational May 2014 ISSN:

Service Function Chaining. Intended status: Informational Expires: January 1, 2015 Peng He Ciena July 1, 2014

Internet Engineering Task Force (IETF) Category: Informational. July Reclassification of Suite B Documents to Historic Status

Intended status: Standards Track. May 21, Assigned BGP extended communities draft-ietf-idr-reserved-extended-communities-03

expires in six months October 1997 Internet Public Key Infrastructure Operational Protocols: FTP and HTTP <draft-ietf-pkix-opp-ftp-http-01.

Expires: April 11, 2019 October 8, 2018

Internet Engineering Task Force (IETF) Category: Informational ISSN: February 2012

Internet Engineering Task Force (IETF) Request for Comments: 6522 STD: 73 January 2012 Obsoletes: 3462 Category: Standards Track ISSN:

S. Santesson. Intended status: Standards Track. September 12, 2012

Intended status: Standards Track Expires: April 26, 2012 Y. Ma Beijing University of Posts and Telecommunications October 24, 2011

Internet Engineering Task Force (IETF) Category: Standards Track. M. Petit-Huguenin Impedance Mismatch November 2013

Network Working Group Request for Comments: 5702 Category: Standards Track October 2009

November 1998 Expires May Storing Certificates in the Domain Name System (DNS)

Binary Encodings for JavaScript Object Notation: JSON-B, JSON-C, JSON-D

Intended status: Informational Expires: March 7, 2019 Huawei Technologies N. Leymann Deutsche Telekom G. Swallow Independent September 3, 2018

Internet Engineering Task Force (IETF) Request for Comments: ISSN: Y. Umaoka IBM December 2010

Internet Engineering Task Force (IETF) Request for Comments: 6594 Category: Standards Track April 2012 ISSN:

Hypertext Transfer Protocol (HTTP/1.1): Authentication

Internet Engineering Task Force (IETF) Request for Comments: 6266 Updates: 2616 June 2011 Category: Standards Track ISSN:

Internet Engineering Task Force (IETF) Category: Informational. May IEEE Information Element for the IETF

IPv6 maintenance Working Group (6man) Updates: 3971, 4861 (if approved) January 12, 2012 Intended status: Standards Track Expires: July 15, 2012

Internet Engineering Task Force. Intended Status: Informational. Additional Reserved Top Level Domains draft-chapin-additional-reserved-tlds-00

Category: Standards Track Cisco Systems D. Tappan Consultant October 2009

Network Working Group. Intended status: Informational. H. Deng. China Mobile. July 4, 2014

Internet Engineering Task Force (IETF) Category: Standards Track ISSN: March 2010

Hypertext Transfer Protocol: Access Control List draft-zhao-http-acl-00

Internet Engineering Task Force (IETF) Obsoletes: 4742 June 2011 Category: Standards Track ISSN:

September 1997 Expires March Storing Certificates in the Domain Name System

Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile draft-ietf-pkix-rfc3280bis-04.

Internet Engineering Task Force (IETF) Updates: 5322 March 2013 Category: Standards Track ISSN:

Category: Informational NIST August Advanced Encryption Standard (AES) Key Wrap with Padding Algorithm

Intended status: Standards Track. K. Patel Cisco J. Haas Juniper Networks June 30, 2014

Internet Engineering Task Force (IETF) Category: Informational ISSN: October 2013

Category: Standards Track Microsoft May 2004

Updates: 4448 (if approved) Intended status: Standards Track Expires: January 3, 2019 July 02, 2018

Internet Engineering Task Force (IETF) Category: Informational July 2012 ISSN: S/MIME Capabilities for Public Key Definitions

Internet Engineering Task Force (IETF) Request for Comments: 8437 Updates: 3501 August 2018 Category: Standards Track ISSN:

D. Crocker, Ed. Updates: RFC4871 June 10, 2009 (if approved) Intended status: Standards Track Expires: December 12, 2009

Internet Engineering Task Force. Intended status: Standards Track. June 7, 2014

Network Working Group. Intended status: Standards Track. AMS-IX A. Fenioux France-IX April 10, 2017

Request for Comments: 5208 Category: Informational May 2008

Internet Engineering Task Force (IETF) BroadSoft August Essential Correction for IPv6 ABNF and URI Comparison in RFC 3261

Internet Engineering Task Force (IETF) Category: Standards Track ISSN: July 2012

Request for Comments: 1154 Prime Computer, Inc. April 1990

Transcription:

Network Working Group Internet-Draft Intended status: Standards Track Expires: January 4, 2015 S. Josefsson SJD AB S. Leonard Penango, Inc. July 3, 2014 Text Encodings of PKIX and CMS Structures draft-josefsson-pkix-textual-05 Abstract This document describes and discusses the text encodings of Public-Key Infrastructure using X.509 (PKIX) Certificates, PKIX Certificate Revocation Lists (CRLs), PKCS #10 Certification Request Syntax, PKCS #7 structures, Cryptographic Message Syntax (CMS), PKCS #8 Private-Key Information Syntax, and Attribute Certificates. The text encodings are well-known, are implemented by several applications and libraries, and are widely deployed. This document is intended to articulate the de-facto rules that existing implementations operate by, and to give recommendations that will promote interoperability going forward. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet- Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts /current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on January 4, 2015. Copyright Notice Copyright (c) 2014 IETF Trust and the persons identified as the document authors. All rights reserved. 1 of 13 7/3/14 11:14 PM

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. 2 of 13 7/3/14 11:14 PM

Table of Contents 1. Introduction 2. General Considerations 3. ABNF 4. Text Encoding of PKIX Certificates 4.1. Encoding 4.2. Explanatory Text 4.3. File Extension 5. Text Encoding of PKIX CRLs 6. Text Encoding of PKCS #10 Certification Request Syntax 7. Text Encoding of PKCS #7 Cryptographic Message Syntax 8. Text Encoding of Cryptographic Message Syntax 9. Text Encoding of PKCS #8 Private Key Info, and One Asymmetric Key 10. Text Encoding of PKCS #8 Encrypted Private Key Info 11. Text Encoding of Attribute Certificates 12. Security Considerations 13. IANA Considerations 14. Acknowledgements 15. References 15.1. Normative References 15.2. Informative References Appendix A. Non-Conforming Examples Authors' Addresses 1. Introduction Several security-related standards used on the Internet define data formats that are normally encoded using Distinguished Encoding Rules (DER) [CCITT.X690.2002], which is a binary data format. This document is about text encodings of some of these formats: 1. 2. 3. 4. 5. 6. Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile [RFC5280], for both Certificates and Certificate Revocation Lists (CRLs). PKCS #10: Certification Request Syntax [RFC2986]. PKCS #7: Cryptographic Message Syntax [RFC2315]. Cryptographic Message Syntax [RFC5652]. PKCS #8: Private-Key Information Syntax [RFC5208] and One Asymmetric Key (in Asymmetric Key Package [RFC5958]). An Internet Attribute Certificate Profile for Authorization [RFC5755]. A disadvantage of a binary data format is that it cannot be interchanged in textual transports, such as e-mail or text documents. One advantage with text encodings is that they are easy to modify using common text editors; for example, a user may 3 of 13 7/3/14 11:14 PM

concatenate several certificates to form a certificate chain with copy-and-paste operations. The tradition within the RFC series can be traced back to PEM [RFC1421], based on a proposal by M. Rose in Message Encapsulation [RFC0934]. Originally called "PEM encapsulation mechanism", "encapsulated PEM message", or (arguably) "PEM printable encoding", today the format is sometimes referred to as "PEM encoding". Variations include OpenPGP ASCII Armor [RFC2015] and OpenSSH Key File Format [RFC4716]. For reasons that basically boil down to non-coordination or inattention, many PKIX and CMS libraries implement a text encoding that is similar to but not identical with PEM encoding. This document specifies the "PKIX text encoding" format, articulates the de-facto rules that most implementations operate by, and provides recommendations that will promote interoperability going forward. This document also provides common nomenclature for syntax elements, reflecting the evolution of this de-facto standard format. Peter Gutmann's X.509 Style Guide [X509SG] contains a section "base64 Encoding" that describes the formats and contains suggestions similar to what is in this document. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119]. 2. General Considerations PKIX text encoding begins with a line starting with -----BEGIN and ends with a line starting with -----END. Between these lines, or "encapsulation boundaries", are base64-encoded [RFC4648] data. Data before the -----BEGIN and after the -----END encapsulation boundaries are permitted and MUST NOT cause parsers to malfunction. Furthermore, parsers MUST ignore whitespace and other non-base64 characters and MUST handle different newline conventions. The type of data encoded is labeled depending on the type label in the -----BEGIN line (pre-encapsulation boundary). For example, the line may be -----BEGIN CERTIFICATE----- to indicate that the content is a PKIX certificate (see further below). Generators MUST put the same label on the -----END line (postencapsulation boundary) as the corresponding -----BEGIN line. Parsers MAY disregard the label on the -----END line instead of signaling an error if there is a label mismatch. The label type implies that the encoded data follows the specified syntax. Parsers MUST handle non-conforming data gracefully. However, not all parsers or generators prior to this Internet-Draft behave consistently. A conforming parser MAY interpret the contents as another label type, but ought to be aware of the security implications discussed in the Security Considerations section. 4 of 13 7/3/14 11:14 PM

Unlike legacy PEM encoding [RFC1421], OpenPGP ASCII armor, and the OpenSSH key file format, PKIX text encoding does not define or permit attributes to be encoded alongside the PKIX or CMS data. Whitespace MAY appear between the pre-encapsulation boundary and the base64, but generators SHOULD NOT emit such whitespace. Files MAY contain multiple PKIX text encoding instances. This is used, for example, when a file contains several certificates. Whether the instances are ordered or unordered depends on the context. Generators MUST wrap the base64 encoded lines so that each line consists of exactly 64 characters except for the final line which will encode the remainder of the data (within the 64 character line boundary). Parsers MAY handle other line sizes. These requirements are consistent with PEM [RFC1421]. 3. ABNF The ABNF of the PKIX text encoding is: pkixmsg preeb posteb ::= preeb *eolwsp base64text posteb ::= "-----BEGIN " label "-----" eol ::= "-----END " label "-----" eol base64char ::= ALPHA / DIGIT / "+" / "/" base64pad ::= "=" base64line ::= 1*base64char eol base64finl ::= *base64char (base64pad eol base64pad / *2base64pad) eol ;...AB= <CRLF> = <CRLF> is not good, but is valid base64text ::= *base64line base64finl ; we could also use <encbinbody> from RFC 1421, which requires ; 16 groups of 4 chars, which means exactly 64 chars per ; line, except the final line, but this is more accurate labelchar ::= %x21-2c / %x2e-%7e ; any printable character, ; except hyphen label eol ::= labelchar *(labelchar / labelchar "-" / SP) labelchar ::= CRLF / CR / LF eolwsp ::= WSP / CR / LF ; compare with LWSP Figure 1: ABNF pkixmsgstrict ::= preeb 5 of 13 7/3/14 11:14 PM

strictbase64text posteb strictbase64finl ::= *15(4base64char) (4base64char / 3base64char base64pad / 2base64char 2base64pad) eol base64fullline ::= 64base64char eol strictbase64text ::= *base64fullline strictbase64finl Figure 2: ABNF (Strict) This specification RECOMMENDS that new implementations emit the strict format [abnf-strict-fig] specified above. 4. Text Encoding of PKIX Certificates 4.1. Encoding PKIX certificates are encoded using the CERTIFICATE label. The encoded data MUST be a DER encoded ASN.1 Certificate structure as described in section 4 of [RFC5280]. -----BEGIN CERTIFICATE----- MIICLDCCAdKgAwIBAgIBADAKBggqhkjOPQQDAjB9MQswCQYDVQQGEwJCRTEPMA0G A1UEChMGR251VExTMSUwIwYDVQQLExxHbnVUTFMgY2VydGlmaWNhdGUgYXV0aG9y axr5mq8wdqydvqqiewzmzxv2zw4xjtajbgnvbamthedudvrmuybjzxj0awzpy2f0 ZSBhdXRob3JpdHkwHhcNMTEwNTIzMjAzODIxWhcNMTIxMjIyMDc0MTUxWjB9MQsw CQYDVQQGEwJCRTEPMA0GA1UEChMGR251VExTMSUwIwYDVQQLExxHbnVUTFMgY2Vy dglmawnhdgugyxv0ag9yaxr5mq8wdqydvqqiewzmzxv2zw4xjtajbgnvbamthedu dvrmuybjzxj0awzpy2f0zsbhdxrob3jpdhkwwtatbgcqhkjopqibbggqhkjopqmb BwNCAARS2I0jiuNn14Y2sSALCX3IybqiIJUvxUpj+oNfzngvj/Niyv2394BWnW4X uq4rteiywk87wrcwmggjb5kx/t2no0mwqtapbgnvhrmbaf8ebtadaqh/ma8ga1ud DwEB/wQFAwMHBgAwHQYDVR0OBBYEFPC0gf6YEr+1KLlkQAPLzB9mTigDMAoGCCqG SM49BAMCA0gAMEUCIDGuwD1KPyG+hRf88MeyMQcqOFZD0TbVleF+UsAGQ4enAiEA l4woudwkqa+upc8gftxe2c//4mkanbc6it01guatipo= -----END CERTIFICATE----- Figure 3: Certificate Example Historically the label X509 CERTIFICATE and also, less common, X.509 CERTIFICATE have been used. Generators conforming to this document MUST generate CERTIFICATE labels and MUST NOT generate X509 CERTIFICATE or X.509 CERTIFICATE labels. Parsers are NOT RECOMMENDED to treat X509 CERTIFICATE or X.509 CERTIFICATE as equivalent to CERTIFICATE, but a valid exception may be for backwards compatibility (potentially together with a warning). 4.2. Explanatory Text Many tools are known to emit explanatory text before the BEGIN and after the END lines for PKIX certificates, more than any other type. If emitted, such text SHOULD be related to the certificate, such as providing a textual representation of key data 6 of 13 7/3/14 11:14 PM

elements in the certificate. Subject: CN=Atlantis Issuer: CN=Atlantis Validity: from 7/9/2012 3:10:38 AM UTC to 7/9/2013 3:10:37 AM UTC -----BEGIN CERTIFICATE----- MIIBmTCCAUegAwIBAgIBKjAJBgUrDgMCHQUAMBMxETAPBgNVBAMTCEF0bGFudGlz MB4XDTEyMDcwOTAzMTAzOFoXDTEzMDcwOTAzMTAzN1owEzERMA8GA1UEAxMIQXRs YW50aXMwXDANBgkqhkiG9w0BAQEFAANLADBIAkEAu+BXo+miabDIHHx+yquqzqNh Ryn/XtkJIIHVcYtHvIX+S1x5ErgMoHehycpoxbErZmVR4GCq1S2diNmRFZCRtQID AQABo4GJMIGGMAwGA1UdEwEB/wQCMAAwIAYDVR0EAQH/BBYwFDAOMAwGCisGAQQB gjccarudageamb0ga1udjqqwmbqgccsgaqufbwmcbggrbgefbqcdaza1bgnvhqee LjAsgBA0jOnSSuIHYmnVryHAdywMoRUwEzERMA8GA1UEAxMIQXRsYW50aXOCASow CQYFKw4DAh0FAANBAKi6HRBaNEL5R0n56nvfclQNaXiDT174uf+lojzA4lhVInc0 ILwpnZ1izL4MlI9eCSHhVQBHEp2uQdXJB+d5Byg= -----END CERTIFICATE----- 4.3. File Extension Figure 4: Certificate Example with Explanatory Text Although text encodings of PKIX structures can occur anywhere, many tools are known to offer an option to encode PKIX structures in this text encoding. To promote interoperability and to separate DER encodings from text encodings, This Internet-Draft RECOMMENDS that the extension ".crt" be used for this text encoding. Implementations should be aware that in spite of this recommendation, many tools still default to encode certificates in this text encoding with the extension ".cer". 5. Text Encoding of PKIX CRLs PKIX CRLs are encoded using the X509 CRL label. The encoded data MUST be a DER encoded ASN.1 CertificateList structure as described in Section 5 of [RFC5280]. -----BEGIN X509 CRL----- MIIB9DCCAV8CAQEwCwYJKoZIhvcNAQEFMIIBCDEXMBUGA1UEChMOVmVyaVNpZ24s IEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxRjBEBgNVBAsT PXd3dy52ZXJpc2lnbi5jb20vcmVwb3NpdG9yeS9SUEEgSW5jb3JwLiBieSBSZWYu LExJQUIuTFREKGMpOTgxHjAcBgNVBAsTFVBlcnNvbmEgTm90IFZhbGlkYXRlZDEm MCQGA1UECxMdRGlnaXRhbCBJRCBDbGFzcyAxIC0gTmV0c2NhcGUxGDAWBgNVBAMU D1NpbW9uIEpvc2Vmc3NvbjEiMCAGCSqGSIb3DQEJARYTc2ltb25Aam9zZWZzc29u Lm9yZxcNMDYxMjI3MDgwMjM0WhcNMDcwMjA3MDgwMjM1WjAjMCECEC4QNwPfRoWd elunpllhhtgxdta2mtiynza4mdiznfowcwyjkozihvcnaqefa4gbad0zx+j2hkcc Nbrq1Dn5IKL8nXLgPGcHv1I/le1MNo9t1ohGQxB5HnFUkRPAY82fR6Epor4aHgVy b+5y+nekn9kn2mpf4iiun+a4o26cjj0parojcl1p8t0yyi9xxvyc/ezaz98hiiyp c3dgmnr+oumsjkz0jihaymelxaphfqwr -----END X509 CRL----- Figure 5: CRL Example Historically the label CRL has rarely been used. Today it is not common and many popular tools do not understand the label. Therefore, this document standardizes X509 CRL in order to promote interoperability and backwards-compatibility. Generators conforming to this document MUST generate X509 CRL labels and MUST 7 of 13 7/3/14 11:14 PM

NOT generate CRL labels. Parsers are NOT RECOMMENDED to treat CRL as equivalent to X509 CRL. 6. Text Encoding of PKCS #10 Certification Request Syntax PKCS #10 Certification Requests are encoded using the CERTIFICATE REQUEST label. The encoded data MUST be a DER encoded ASN.1 CertificationRequest structure as described in [RFC2986]. -----BEGIN CERTIFICATE REQUEST----- MIIBWDCCAQcCAQAwTjELMAkGA1UEBhMCU0UxJzAlBgNVBAoTHlNpbW9uIEpvc2Vm c3nvbibeyxrha29uc3vsdcbbqjewmbqga1ueaxmnam9zzwzzc29ulm9yzzbombag ByqGSM49AgEGBSuBBAAhAzoABLLPSkuXY0l66MbxVJ3Mot5FCFuqQfn6dTs+9/CM EOlSwVej77tj56kj9R/j9Q+LfysX8FO9I5p3oGIwYAYJKoZIhvcNAQkOMVMwUTAY BgNVHREEETAPgg1qb3NlZnNzb24ub3JnMAwGA1UdEwEB/wQCMAAwDwYDVR0PAQH/ BAUDAwegADAWBgNVHSUBAf8EDDAKBggrBgEFBQcDATAKBggqhkjOPQQDAgM/ADA8 AhxBvfhxPFfbBbsE1NoFmCUczOFApEuQVUw3ZP69AhwWXk3dgSUsKnuwL5g/ftAY deqc8b8jacnuorfu -----END CERTIFICATE REQUEST----- Figure 6: PKCS #10 Example The label NEW CERTIFICATE REQUEST is also in wide use. Generators conforming to this document MUST generate CERTIFICATE REQUEST labels. Parsers MAY treat NEW CERTIFICATE REQUEST as equivalent to CERTIFICATE REQUEST. 7. Text Encoding of PKCS #7 Cryptographic Message Syntax PKCS #7 Cryptographic Message Syntax structures are encoded using the PKCS7 label. The encoded data MUST be a DER encoded ASN.1 ContentInfo structure as described in [RFC2315]. -----BEGIN PKCS7----- MIHjBgsqhkiG9w0BCRABF6CB0zCB0AIBADFho18CAQCgGwYJKoZIhvcNAQUMMA4E CLfrI6dr0gUWAgITiDAjBgsqhkiG9w0BCRADCTAUBggqhkiG9w0DBwQIZpECRWtz u5kegdcjerxy8odq7eeeromzjvaurk/j81irozbsbgkqhkig9w0bbwewmwylkozi hvcnaqkqaw8wjdaubggqhkig9w0dbwqi0tcbcu09nxewdayikwybbquiaqifaiaq OsYGYUFdAH0RNc1p4VbKEAQUM2Xo8PMHBoYdqEcsbTodlCFAZH4= -----END PKCS7----- Figure 7: PKCS #7 Example The label CERTIFICATE CHAIN has been in use to denote a degenerative PKCS #7 structure that contains only a list of certificates. Several modern tools do not support this label. Generators MUST NOT generate the CERTIFICATE CHAIN label. Parsers are NOT RECOMMENDED to treat CERTIFICATE CHAIN as equivalent to PKCS7. PKCS #7 is an old standard that has long been superseded by CMS [RFC5652]. Implementations SHOULD NOT generate PKCS #7 when CMS is an alternative. 8. Text Encoding of Cryptographic Message Syntax 8 of 13 7/3/14 11:14 PM

Cryptographic Message Syntax structures are encoded using the CMS label. The encoded data MUST be a DER encoded ASN.1 ContentInfo structure as described in [RFC5652]. -----BEGIN CMS----- MIGDBgsqhkiG9w0BCRABCaB0MHICAQAwDQYLKoZIhvcNAQkQAwgwXgYJKoZIhvcN AQcBoFEET3icc87PK0nNK9ENqSxItVIoSa0o0S/ISczMs1ZIzkgsKk4tsQ0N1nUM dvb05oxi5xlpletvimwvlvlwse0sklfivhaqsk3mbkkbajv0fx0= -----END CMS----- Figure 8: CMS Example CMS is the IETF successor to PKCS #7. Section 1.1.1 of [RFC5652] describes the changes since PKCS #7 v1.5. Implementations SHOULD generate CMS when it is an alternative, promoting interoperability and forwards-compatibility. 9. Text Encoding of PKCS #8 Private Key Info, and One Asymmetric Key Unencrypted PKCS #8 Private Key Information Syntax structures (PrivateKeyInfo), renamed to Asymmetric Key Packages (OneAsymmetricKey), are encoded using the PRIVATE KEY label. The encoded data MUST be a DER encoded ASN.1 PrivateKeyInfo structure as described in PKCS #8 [RFC5208], or a OneAsymmetricKey structure as described in [RFC5958]. The two are semantically identical, and can be distinguished by version number. -----BEGIN PRIVATE KEY----- MIGEAgEAMBAGByqGSM49AgEGBSuBBAAKBG0wawIBAQQgVcB/UNPxalR9zDYAjQIf jojudiqugnsjrfeezzpt/92hrancaasc7ujtgnf/abqwm60t3xnjezbv5ez9tdwk H0M6xpM2q+53wmsN/eYLdgtjgBd3DBmHtPilCkiFICXyaA8z9LkJ -----END PRIVATE KEY----- Figure 9: PKCS #8 PrivateKeyInfo Example 10. Text Encoding of PKCS #8 Encrypted Private Key Info Encrypted PKCS #8 Private Key Information Syntax structures (EncryptedPrivateKeyInfo), called the same in [RFC5958], are encoded using the ENCRYPTED PRIVATE KEY label. The encoded data MUST be a DER encoded ASN.1 EncryptedPrivateKeyInfo structure as described in PKCS #8 [RFC5208] and [RFC5958]. -----BEGIN ENCRYPTED PRIVATE KEY----- MIHNMEAGCSqGSIb3DQEFDTAzMBsGCSqGSIb3DQEFDDAOBAghhICA6T/51QICCAAw FAYIKoZIhvcNAwcECBCxDgvI59i9BIGIY3CAqlMNBgaSI5QiiWVNJ3IpfLnEiEsW Z0JIoHyRmKK/+cr9QPLnzxImm0TR9s4JrG3CilzTWvb0jIvbG3hu0zyFPraoMkap 8eRzWsIvC5SVel+CSjoS2mVS87cyjlD+txrmrXOVYDE+eTgMLbrLmsWh3QkCTRtF QC7k0NNzUHTV9yGDwfqMbw== -----END ENCRYPTED PRIVATE KEY----- Figure 10: PKCS #8 EncryptedPrivateKeyInfo Example 9 of 13 7/3/14 11:14 PM

11. Text Encoding of Attribute Certificates Attribute certificates are encoded using the ATTRIBUTE CERTIFICATE label. The encoded data MUST be a DER encoded ASN.1 AttributeCertificate structure as described in [RFC5755]. -----BEGIN ATTRIBUTE CERTIFICATE----- MIICKzCCAZQCAQEwgZeggZQwgYmkgYYwgYMxCzAJBgNVBAYTAlVTMREwDwYDVQQI DAhOZXcgWW9yazEUMBIGA1UEBwwLU3RvbnkgQnJvb2sxDzANBgNVBAoMBkNTRTU5 MjE6MDgGA1UEAwwxU2NvdHQgU3RhbGxlci9lbWFpbEFkZHJlc3M9c3N0YWxsZXJA awmuc3vuexnilmvkdqigarwrguusoigmmigjpiggmigdmqswcqydvqqgewjvuzer MA8GA1UECAwITmV3IFlvcmsxFDASBgNVBAcMC1N0b255IEJyb29rMQ8wDQYDVQQK DAZDU0U1OTIxOjA4BgNVBAMMMVNjb3R0IFN0YWxsZXIvZW1haWxBZGRyZXNzPXNz dgfsbgvyqgljlnn1bnlzyi5lzhuwdqyjkozihvcnaqefbqacbgevq4ffsjaiga8z OTA3MDIwMTA1MDAwMFoYDzM5MTEwMTMxMDUwMDAwWjArMCkGA1UYSDEiMCCGHmh0 dha6ly9pzgvyyxnobi5vcmcvaw5kzxguahrtbdanbgkqhkig9w0baqufaaobgqav M9axFPXXozEFcer06bj9MCBBCQLtAM7ZXcZjcxyva7xCBDmtZXPYUluHf5OcWPJz 5XPus/xS9wBgtlM3fldIKNyNO8RsMp6Ocx+PGlICc7zpZiGmCYLl64lAEGPO/bsw Smluak1aZIttePeTAHeJJs8izNJ5aR3Wcd3A5gLztQ== -----END ATTRIBUTE CERTIFICATE----- 12. Security Considerations Figure 11: Attribute Certificate Example Data in this format often originates from untrusted sources, thus parsers must be prepared to handle unexpected data without causing security vulnerabilities. Ambiguities are introduced by having more than one canonical encoding of the same data. The first ambiguity is introduced by permitting the text encoded representation instead of the binary DER encoding, but further ambiguities arise when multiple labels are treated as similar. Variations of whitespace and non-base64 alphabetic characters can create further ambiguities. Implementations that rely on canonical representation or the ability to fingerprint a particular data format need to understand that this Internet-Draft does not define canonical encodings. If canonical encodings are desired, the encoded structure must be decoded and processed into a canonical form (namely, DER encoding). Data encoding ambiguities also create opportunities for side channels. 13. IANA Considerations This document implies no IANA Considerations. 14. Acknowledgements Peter Gutmann suggested to document labels for Attribute Certificates and PKCS #7 messages, and to add examples for the non-standard variants. 15. References 10 of 13 7/3/14 11:14 PM

15.1. Normative References [RFC2119] [RFC2315] [RFC2986] [RFC4648] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. Kaliski, B., "PKCS #7: Cryptographic Message Syntax Version 1.5", RFC 2315, March 1998. Nystrom, M. and B. Kaliski, "PKCS #10: Certification Request Syntax Specification Version 1.7", RFC 2986, November 2000. Josefsson, S., "The Base16, Base32, and Base64 Data Encodings", RFC 4648, October 2006. [RFC5208] Kaliski, B., "Public-Key Cryptography Standards (PKCS) #8: Private-Key Information Syntax Specification Version 1.2", RFC 5208, May 2008. [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R. and W. Polk, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 5280, May 2008. [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, RFC 5652, September 2009. [RFC5755] [RFC5958] [CCITT.X690.2002] 15.2. Informative References [RFC0934] Farrell, S., Housley, R. and S. Turner, "An Internet Attribute Certificate Profile for Authorization", RFC 5755, January 2010. Turner, S., "Asymmetric Key Packages", RFC 5958, August 2010. International Telephone and Telegraph Consultative Committee, "ASN.1 encoding rules: Specification of basic encoding Rules (BER), Canonical encoding rules (CER) and Distinguished encoding rules (DER)", CCITT Recommendation X.690, July 2002. Rose, M. and E. Stefferud, "Proposed standard for message encapsulation", RFC 934, January 1985. [RFC1421] Linn, J., "Privacy Enhancement for Internet Electronic Mail: Part I: Message Encryption and Authentication Procedures", RFC 1421, February 1993. [RFC2015] Elkins, M., "MIME Security with Pretty Good Privacy (PGP)", RFC 2015, October 1996. [RFC4716] [X509SG] Galbraith, J. and R. Thayer, "The Secure Shell (SSH) Public Key File Format", RFC 4716, November 2006. Gutmann, P., "X.509 Style Guide", WWW http://www.cs.auckland.ac.nz /~pgut001/pubs/x509guide.txt, October 2000. 11 of 13 7/3/14 11:14 PM

Appendix A. Non-Conforming Examples This section contains examples for the non-recommended label variants described earlier in this document. As discussed earlier, supporting these are not required and sometimes discouraged. Still, they can be useful for interoperability testing and for easy reference. -----BEGIN X509 CERTIFICATE----- MIICLDCCAdKgAwIBAgIBADAKBggqhkjOPQQDAjB9MQswCQYDVQQGEwJCRTEPMA0G A1UEChMGR251VExTMSUwIwYDVQQLExxHbnVUTFMgY2VydGlmaWNhdGUgYXV0aG9y axr5mq8wdqydvqqiewzmzxv2zw4xjtajbgnvbamthedudvrmuybjzxj0awzpy2f0 ZSBhdXRob3JpdHkwHhcNMTEwNTIzMjAzODIxWhcNMTIxMjIyMDc0MTUxWjB9MQsw CQYDVQQGEwJCRTEPMA0GA1UEChMGR251VExTMSUwIwYDVQQLExxHbnVUTFMgY2Vy dglmawnhdgugyxv0ag9yaxr5mq8wdqydvqqiewzmzxv2zw4xjtajbgnvbamthedu dvrmuybjzxj0awzpy2f0zsbhdxrob3jpdhkwwtatbgcqhkjopqibbggqhkjopqmb BwNCAARS2I0jiuNn14Y2sSALCX3IybqiIJUvxUpj+oNfzngvj/Niyv2394BWnW4X uq4rteiywk87wrcwmggjb5kx/t2no0mwqtapbgnvhrmbaf8ebtadaqh/ma8ga1ud DwEB/wQFAwMHBgAwHQYDVR0OBBYEFPC0gf6YEr+1KLlkQAPLzB9mTigDMAoGCCqG SM49BAMCA0gAMEUCIDGuwD1KPyG+hRf88MeyMQcqOFZD0TbVleF+UsAGQ4enAiEA l4woudwkqa+upc8gftxe2c//4mkanbc6it01guatipo= -----END X509 CERTIFICATE----- Figure 12: Non-standard 'X509' Certificate Example -----BEGIN X.509 CERTIFICATE----- MIICLDCCAdKgAwIBAgIBADAKBggqhkjOPQQDAjB9MQswCQYDVQQGEwJCRTEPMA0G A1UEChMGR251VExTMSUwIwYDVQQLExxHbnVUTFMgY2VydGlmaWNhdGUgYXV0aG9y axr5mq8wdqydvqqiewzmzxv2zw4xjtajbgnvbamthedudvrmuybjzxj0awzpy2f0 ZSBhdXRob3JpdHkwHhcNMTEwNTIzMjAzODIxWhcNMTIxMjIyMDc0MTUxWjB9MQsw CQYDVQQGEwJCRTEPMA0GA1UEChMGR251VExTMSUwIwYDVQQLExxHbnVUTFMgY2Vy dglmawnhdgugyxv0ag9yaxr5mq8wdqydvqqiewzmzxv2zw4xjtajbgnvbamthedu dvrmuybjzxj0awzpy2f0zsbhdxrob3jpdhkwwtatbgcqhkjopqibbggqhkjopqmb BwNCAARS2I0jiuNn14Y2sSALCX3IybqiIJUvxUpj+oNfzngvj/Niyv2394BWnW4X uq4rteiywk87wrcwmggjb5kx/t2no0mwqtapbgnvhrmbaf8ebtadaqh/ma8ga1ud DwEB/wQFAwMHBgAwHQYDVR0OBBYEFPC0gf6YEr+1KLlkQAPLzB9mTigDMAoGCCqG SM49BAMCA0gAMEUCIDGuwD1KPyG+hRf88MeyMQcqOFZD0TbVleF+UsAGQ4enAiEA l4woudwkqa+upc8gftxe2c//4mkanbc6it01guatipo= -----END X.509 CERTIFICATE----- Figure 13: Non-standard 'X.509' Certificate Example -----BEGIN NEW CERTIFICATE REQUEST----- MIIBWDCCAQcCAQAwTjELMAkGA1UEBhMCU0UxJzAlBgNVBAoTHlNpbW9uIEpvc2Vm c3nvbibeyxrha29uc3vsdcbbqjewmbqga1ueaxmnam9zzwzzc29ulm9yzzbombag ByqGSM49AgEGBSuBBAAhAzoABLLPSkuXY0l66MbxVJ3Mot5FCFuqQfn6dTs+9/CM EOlSwVej77tj56kj9R/j9Q+LfysX8FO9I5p3oGIwYAYJKoZIhvcNAQkOMVMwUTAY BgNVHREEETAPgg1qb3NlZnNzb24ub3JnMAwGA1UdEwEB/wQCMAAwDwYDVR0PAQH/ BAUDAwegADAWBgNVHSUBAf8EDDAKBggrBgEFBQcDATAKBggqhkjOPQQDAgM/ADA8 AhxBvfhxPFfbBbsE1NoFmCUczOFApEuQVUw3ZP69AhwWXk3dgSUsKnuwL5g/ftAY deqc8b8jacnuorfu -----END NEW CERTIFICATE REQUEST----- Figure 14: Non-standard 'NEW' PKCS #10 Example -----BEGIN CERTIFICATE CHAIN----- MIHjBgsqhkiG9w0BCRABF6CB0zCB0AIBADFho18CAQCgGwYJKoZIhvcNAQUMMA4E 12 of 13 7/3/14 11:14 PM

CLfrI6dr0gUWAgITiDAjBgsqhkiG9w0BCRADCTAUBggqhkiG9w0DBwQIZpECRWtz u5kegdcjerxy8odq7eeeromzjvaurk/j81irozbsbgkqhkig9w0bbwewmwylkozi hvcnaqkqaw8wjdaubggqhkig9w0dbwqi0tcbcu09nxewdayikwybbquiaqifaiaq OsYGYUFdAH0RNc1p4VbKEAQUM2Xo8PMHBoYdqEcsbTodlCFAZH4= -----END CERTIFICATE CHAIN----- Authors' Addresses Simon Josefsson SJD AB Johan Olof Wallins Väg 13 Solna, 171 64 SE EMail: simon@josefsson.org URI: http://josefsson.org/ Figure 15: Non-standard 'CERTIFICATE CHAIN' Example Sean Leonard Penango, Inc. 5900 Wilshire Boulevard 21st Floor Los Angeles, CA 90036 USA EMail: dev+ietf@seantek.com URI: http://www.penango.com/ 13 of 13 7/3/14 11:14 PM