Independent Submission N. Mavrogiannopoulos Request for Comments: 8479 Red Hat Category: Informational September 2018 ISSN: 2070-1721
Independent Submission N. Mavrogiannopoulos Request for Comments: 8479 Red Hat Category: Informational September 2018 ISSN: 2070-1721
Storing Validation Parameters in PKCS#8
在PKCS#8中存储验证参数
Abstract
摘要
This memo describes a method of storing parameters needed for private-key validation in the Private-Key Information Syntax Specification as defined in PKCS#8 format (RFC 5208). It is equally applicable to the alternative implementation of the Private-Key Information Syntax Specification as defined in RFC 5958.
本备忘录描述了在PKCS#8格式(RFC 5208)中定义的私钥信息语法规范中存储私钥验证所需参数的方法。它同样适用于RFC 5958中定义的私钥信息语法规范的替代实现。
The approach described in this document encodes the parameters under a private enterprise extension and does not form part of a formal standard.
本文档中描述的方法对私有企业扩展下的参数进行编码,不构成正式标准的一部分。
Status of This Memo
关于下段备忘
This document is not an Internet Standards Track specification; it is published for informational purposes.
本文件不是互联网标准跟踪规范;它是为了提供信息而发布的。
This is a contribution to the RFC Series, independently of any other RFC stream. The RFC Editor has chosen to publish this document at its discretion and makes no statement about its value for implementation or deployment. Documents approved for publication by the RFC Editor are not candidates for any level of Internet Standard; see Section 2 of RFC 7841.
这是对RFC系列的贡献,独立于任何其他RFC流。RFC编辑器已选择自行发布此文档,并且未声明其对实现或部署的价值。RFC编辑批准发布的文件不适用于任何级别的互联网标准;见RFC 7841第2节。
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc8479.
有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问https://www.rfc-editor.org/info/rfc8479.
Copyright Notice
版权公告
Copyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved.
版权所有(c)2018 IETF信托基金和确定为文件作者的人员。版权所有。
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://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.
本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(https://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。
Table of Contents
目录
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 2. ValidationParams Attribute . . . . . . . . . . . . . . . . . 3 3. Example Structure . . . . . . . . . . . . . . . . . . . . . . 4 4. Compatibility Notes . . . . . . . . . . . . . . . . . . . . . 4 5. Security Considerations . . . . . . . . . . . . . . . . . . . 5 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 7.1. Normative References . . . . . . . . . . . . . . . . . . 5 7.2. Informative References . . . . . . . . . . . . . . . . . 6 Appendix A. ASN.1 Module . . . . . . . . . . . . . . . . . . . . 7 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 8 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 2. ValidationParams Attribute . . . . . . . . . . . . . . . . . 3 3. Example Structure . . . . . . . . . . . . . . . . . . . . . . 4 4. Compatibility Notes . . . . . . . . . . . . . . . . . . . . . 4 5. Security Considerations . . . . . . . . . . . . . . . . . . . 5 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 7.1. Normative References . . . . . . . . . . . . . . . . . . 5 7.2. Informative References . . . . . . . . . . . . . . . . . 6 Appendix A. ASN.1 Module . . . . . . . . . . . . . . . . . . . . 7 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 8 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8
RSA or DSA private keys generated using the Shawe-Taylor prime generation algorithm described in [FIPS186-4] allow for parameter validation, i.e., they verify whether the primes are actually prime and were correctly generated. That is done by generating the parameters from a known seed and a selected hash algorithm.
使用[FIPS186-4]中所述的Shawe-Taylor素数生成算法生成的RSA或DSA私钥允许进行参数验证,即验证素数是否实际为素数且是否正确生成。这是通过从已知种子和选定的哈希算法生成参数来实现的。
Storing these parameters in a private-key format such as the RSA Private-Key Syntax from PKCS#1 [RFC8017] or common representations for DSA private keys does not allow information needed for validation to be attached to the parameters. The purpose of this document is to describe such a method using the Private-Key Information Syntax Specification as defined in [RFC5208] and the alternative specification described in [RFC5958].
以私钥格式存储这些参数,例如PKCS#1[RFC8017]中的RSA私钥语法或DSA私钥的通用表示形式,不允许将验证所需的信息附加到参数。本文件的目的是使用[RFC5208]中定义的私钥信息语法规范和[RFC5958]中描述的替代规范来描述此类方法。
The approach described in this document encodes the parameters under a private enterprise extension and does not form part of a formal standard. The encoding can be used as is or as the basis for a standard at a later time.
本文档中描述的方法对私有企业扩展下的参数进行编码,不构成正式标准的一部分。编码可以按原样使用,也可以在以后用作标准的基础。
The information related to the validation parameters is stored as an attribute in the PrivateKeyInfo structure. The attribute is identified by the id-attr-validation-parameters object identifier and contains as AttributeValue a single ValidationParams structure.
与验证参数相关的信息作为属性存储在PrivateKeyInfo结构中。该属性由id attr validation parameters对象标识符标识,并包含一个ValidationParams结构作为AttributeValue。
id-attr-validation-parameters OBJECT IDENTIFIER ::= {1 3 6 1 4 1 2312 18 8 1}
id-attr-validation-parameters OBJECT IDENTIFIER ::= {1 3 6 1 4 1 2312 18 8 1}
ValidationParams ::= SEQUENCE { hashAlgo OBJECT IDENTIFIER, seed OCTET STRING }
ValidationParams ::= SEQUENCE { hashAlgo OBJECT IDENTIFIER, seed OCTET STRING }
The algorithm identifier in ValidationParams should be a hash algorithm identifier for the methods described in [FIPS186-4]. The ValidationParams sequence must be DER encoded [ITU-T-X690].
ValidationParams中的算法标识符应为[FIPS186-4]中所述方法的哈希算法标识符。ValidationParams序列必须进行DER编码[ITU-T-X690]。
The following structure contains an RSA key generated using the algorithm from Section B.3.3 of [FIPS186-4], with SHA2-384 hash. The seed used is 8af4328c87bebcec31e303b8f5537effcb6a91d947084d99a369823b36f01462 (hex encoded).
以下结构包含使用[FIPS186-4]第B.3.3节中的算法生成的RSA密钥以及SHA2-384哈希。使用的种子是8af4328c87bebcec31e303b8f5537effcb6a91d947084d99a369823b36f01462(十六进制编码)。
-----BEGIN PRIVATE KEY----- MIIE/gIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCpPwXwfhDsWA3q jN2BWg1xfDjvZDVNfgTV/b95g304Aty3z13xPXAhHZ3ROW3pgPxTj9fiq7ZMy4Ua gMpPK81v3pHX1uokC2KcGXbgbAq2Q8ClxSXgEJllRwDENufjEdV10gArt8NlIP0N lota1kQUuI1DMsqc5DTIa35Nq4j1GW+KmLtP0kCrGq9fMGwjDbPEpSp9DTquEMHJ o7kyJIjB+93ikLvBUTgbxr+jcnTLXuhA8rC8r+KXre4NPPNPRyefRcALLt/URvfA rTvFOQfi3vIjNhBZL5FdC+FVAr5QnF3r2+cuDPbnczr4/rr81kzFGWrwyAgF5FWu pFtB5IYDAgMBAAECggEAHZ88vGNsNdmRkfhWupGW4cKCuo+Y7re8Q/H2Jd/4Nin2 FKvUPuloaztiSGDbVm+vejama/Nu5FEIumNJRYMeoVJcx2DDuUxO1ZB1aIEwfMct /DWd0/JDzuCXB0Cu5GTWLhlz0zMGHXihIdQ0DtGKt++3Ncg5gy1D+cIqqJB515/z jYdZmb0Wqmz7H3DisuxvnhiCAOuNrjcDau80hpMA9TQlb+XKNGHIBgKpJe6lnB0P MsS/AjDiDoEpP9GG9mv9+96rAga4Nos6avYlwWwbC6d+hHIWvWEWsmrDfcJlm2gN tjvG8omj00t5dAt7qGhfOoNDGr5tvJVo/g96O/0I8QKBgQDdzytVRulo9aKVdAYW /Nj04thtnRaqsTyFH+7ibEVwNIUuld/Bp6NnuGrY+K1siX8+zA9f8mKxuXXV9KK4 O89Ypw9js2BxM7VYO9Gmp6e1RY3Rrd8w7pG7/KqoPWXkuixTay9eybrJMWu3TT36 q7NheNmBHqcFmSQQuUwEmvp3MQKBgQDDVaisMJkc/sIyQh3XrlfzmMLK+GlPDucD w5e50fHl8Q5PmTcP20zVLhTevffCq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ezNS1+exd55WTIcExTgL tvYZMhgsh8tRgfLWpXor7kWmdBrgeflFiOxZIL1/AoGAeBP7sdE+gzsh8jqFnVRj 7nOg+YllJAlWsf7cTH4pLIy2Eo9D+cNjhL9LK6RaAd7PSZ1adm8HfaROA2cfCm84 RI4c7Ue0G+N6LZiFvC0Bfi5SaPVAExXOty8UqjOCoZavSaXBPuNcTXZuzswcgbxI G5/kaJNHoEcdlVsPsYWKRNKgPzA9BgorBgEEAZIIEggBMS8wLQYJYIZIAWUDBAIC BCCK9DKMh7687DHjA7j1U37/y2qR2UcITZmjaYI7NvAUYg== -----END PRIVATE KEY-----
For compatibility, it is recommended that implementations following this document support generation and validation using the SHA2-384 hash algorithm.
为了兼容性,建议遵循本文档的实现支持使用SHA2-384哈希算法生成和验证。
The extension defined in this document is applicable both to the Private-Key Information Syntax Specification (PKCS#8) [RFC5208] and to Asymmetric Key Packages [RFC5958].
本文档中定义的扩展适用于私钥信息语法规范(PKCS#8)[RFC5208]和非对称密钥包[RFC5958]。
All the considerations in [RFC5208] and [RFC5958] apply.
[RFC5208]和[RFC5958]中的所有注意事项均适用。
This document has no IANA actions.
本文档没有IANA操作。
[FIPS186-4] National Institute of Standards and Technology, "Digital Signature Standard (DSS)", FIPS PUB 186-4, DOI 10.6028/NIST.FIPS.186-4, July 2013.
[FIPS186-4]国家标准与技术研究所,“数字签名标准(DSS)”,FIPS PUB 186-4,DOI 10.6028/NIST.FIPS.186-42013年7月。
[ITU-T-X680] International Telecommunication Union, "Abstract Syntax Notation One (ASN.1): Specification of basic notation", ITU-T Recommendation X.680, July 2002, <https://www.itu.int/ITU-T/studygroups/com17/languages/ X.680-0207.pdf>.
[ITU-T-X680]国际电信联盟,“抽象语法符号一(ASN.1):基本符号规范”,ITU-T建议X.680,2002年7月<https://www.itu.int/ITU-T/studygroups/com17/languages/ X.680-0207.pdf>。
[ITU-T-X690] International Telecommunication Union, "ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)", ITU-T Recommendation X.690, July 2002, <https://www.itu.int/ITU-T/studygroups/com17/languages/ X.690-0207.pdf>.
[ITU-T-X690]国际电信联盟,“ASN.1编码规则:基本编码规则(BER)、规范编码规则(CER)和区分编码规则(DER)规范”,ITU-T建议X.690,2002年7月<https://www.itu.int/ITU-T/studygroups/com17/languages/ X.690-0207.pdf>。
[RFC5208] Kaliski, B., "Public-Key Cryptography Standards (PKCS) #8: Private-Key Information Syntax Specification Version 1.2", RFC 5208, DOI 10.17487/RFC5208, May 2008, <https://www.rfc-editor.org/info/rfc5208>.
[RFC5208]Kaliski,B,“公钥密码标准(PKCS)#8:私钥信息语法规范版本1.2”,RFC 5208,DOI 10.17487/RFC5208,2008年5月<https://www.rfc-editor.org/info/rfc5208>.
[RFC5958] Turner, S., "Asymmetric Key Packages", RFC 5958, DOI 10.17487/RFC5958, August 2010, <https://www.rfc-editor.org/info/rfc5958>.
[RFC5958]Turner,S.,“非对称密钥包”,RFC 5958,DOI 10.17487/RFC5958,2010年8月<https://www.rfc-editor.org/info/rfc5958>.
[RFC5912] Hoffman, P. and J. Schaad, "New ASN.1 Modules for the Public Key Infrastructure Using X.509 (PKIX)", RFC 5912, DOI 10.17487/RFC5912, June 2010, <https://www.rfc-editor.org/info/rfc5912>.
[RFC5912]Hoffman,P.和J.Schaad,“使用X.509(PKIX)的公钥基础设施的新ASN.1模块”,RFC 5912,DOI 10.17487/RFC5912,2010年6月<https://www.rfc-editor.org/info/rfc5912>.
[RFC8017] Moriarty, K., Ed., Kaliski, B., Jonsson, J., and A. Rusch, "PKCS #1: RSA Cryptography Specifications Version 2.2", RFC 8017, DOI 10.17487/RFC8017, November 2016, <https://www.rfc-editor.org/info/rfc8017>.
[RFC8017]Moriarty,K.,Ed.,Kaliski,B.,Jonsson,J.,和A.Rusch,“PKCS#1:RSA加密规范版本2.2”,RFC 8017,DOI 10.17487/RFC8017,2016年11月<https://www.rfc-editor.org/info/rfc8017>.
This appendix provides non-normative ASN.1 definitions for the structures described in this specification using ASN.1 as defined in [ITU-T-X680] and [RFC5912].
本附录使用[ITU-T-X680]和[RFC5912]中定义的ASN.1为本规范中描述的结构提供了非规范性ASN.1定义。
PrivateKeyValidationAttrV1 { iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) 2312 18 1 1 }
PrivateKeyValidationAttrV1 { iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) 2312 18 1 1 }
DEFINITIONS IMPLICIT TAGS ::=
DEFINITIONS IMPLICIT TAGS ::=
BEGIN
开始
-- EXPORTS ALL
--全部出口
IMPORTS
进口
ATTRIBUTE FROM PKIX-CommonTypes-2009 -- [RFC5912] { iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) id-mod-pkixCommon-02(57) } ;
ATTRIBUTE FROM PKIX-CommonTypes-2009 -- [RFC5912] { iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) id-mod-pkixCommon-02(57) } ;
-- PrivateKeyInfo is defined in [RFC5208]. -- This definition adds the validation parameters attribute -- to the set of allowed attributes.
-- PrivateKeyInfo is defined in [RFC5208]. -- This definition adds the validation parameters attribute -- to the set of allowed attributes.
PrivateKeyInfo ATTRIBUTE ::= { at-validation-parameters, ... }
PrivateKeyInfo ATTRIBUTE ::= { at-validation-parameters, ... }
at-validation-parameters ATTRIBUTE ::= { TYPE ValidationParams IDENTIFIED BY id-attr-validation-parameters }
at-validation-parameters ATTRIBUTE ::= { TYPE ValidationParams IDENTIFIED BY id-attr-validation-parameters }
id-attr-validation-parameters OBJECT IDENTIFIER ::= { 1 3 6 1 4 1 2312 18 8 1 }
id-attr-validation-parameters OBJECT IDENTIFIER ::= { 1 3 6 1 4 1 2312 18 8 1 }
ValidationParams ::= SEQUENCE { hashAlg OBJECT IDENTIFIER, seed OCTET STRING }
ValidationParams ::= SEQUENCE { hashAlg OBJECT IDENTIFIER, seed OCTET STRING }
END
终止
Acknowledgements
致谢
The author would like to thank Russ Housley for his comments and the ASN.1 module appendix.
作者要感谢Russ Housley的评论和ASN.1模块附录。
Author's Address
作者地址
Nikos Mavrogiannopoulos Red Hat, Inc. Brno Czech Republic
Nikos Mavrogiannopoulos Red Hat,Inc.捷克共和国布尔诺
Email: nmav@redhat.com
Email: nmav@redhat.com