RFC 8479

Storing Validation Parameters in PKCS#8

πŸ“… published September 2018, from ietf

Storing Validation Parameters in PKCS#8 πŸ’–

  • RFC: 8479 πŸŽ€
  • Title: Storing Validation Parameters in PKCS#8 ✨
  • Author: Nikos Mavrogiannopoulos (the header says N. Mavrogiannopoulos), at Red Hat 🧚
  • Stream: Independent Submission πŸ¦‹
  • Category: Informational 🌸
  • Date: September 2018 πŸ“…
  • ISSN: 2070-1721
  • Obsoletes / Updates: the header doesn't list any RFCs as obsoleted or updated πŸ™ˆ

Abstract

okay so this memo is about a way to store the extra parameters you need for private-key validation inside PKCS#8 format, which is defined in RFC 5208 πŸ” It works the same way for the alternative version of the Private-Key Information Syntax in RFC 5958, so it's giving versatile πŸ’…

The trick is that the parameters get encoded under a private enterprise extension, and this doc is not a formal standard, just vibes and a good idea 🫢

Status of This Memo

this one is not an Internet Standards Track spec, it's just published for info purposes πŸ“š

It's a contribution to the RFC Series, separate from any other RFC stream. The RFC Editor picked to publish it at their discretion and doesn't say anything about whether you should implement it or deploy it. Docs approved by the RFC Editor aren't candidates for any level of Internet Standard, see Section 2 of RFC 7841 πŸ’–

If you want the current status, errata, or a way to send feedback, check https://www.rfc-editor.org/info/rfc8479 ✨

Copyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved. 🌈

This doc is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) as they stand on the publication date. Read those carefully, bestie, because they spell out your rights and restrictions for this document πŸ“œ

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 ✨

okay so RSA or DSA private keys generated with the Shawe-Taylor prime generation algorithm from [FIPS186-4] can do parameter validation 🧠 That means they check whether the primes are actually prime and were generated correctly. The way they do it is by regenerating the parameters from a known seed and a chosen hash algorithm.

The problem is that if you store these parameters in a private-key format like the RSA Private-Key Syntax from PKCS#1 [RFC8017] or the usual representations for DSA private keys, there's no spot to attach the info needed for validation 😭 So this doc describes a method that uses the Private-Key Information Syntax Specification from [RFC5208] and the alternative spec in [RFC5958] πŸŽ€

The approach here encodes the parameters under a private enterprise extension and isn't a formal standard. You can use the encoding as is, or use it as the basis for a standard later on πŸ¦‹

2. ValidationParams Attribute πŸ’…

The validation parameter info is stored as an attribute in the PrivateKeyInfo structure. The attribute is identified by the id-attr-validation-parameters object identifier, and its AttributeValue is one single ValidationParams structure πŸ”‘

  id-attr-validation-parameters OBJECT IDENTIFIER ::=
                                           {1 3 6 1 4 1 2312 18 8 1}

  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]. And the ValidationParams sequence MUST be DER encoded [ITU-T-X690] 🫢 No skipping this part, periodt πŸ’€

3. Example Structure 🧚

This example structure holds an RSA key made with the algorithm from Section B.3.3 of [FIPS186-4], using SHA2-384 as the hash. The seed is 8af4328c87bebcec31e303b8f5537effcb6a91d947084d99a369823b36f01462 (hex encoded) 🌸

-----BEGIN PRIVATE KEY-----
MIIE/gIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCpPwXwfhDsWA3q
jN2BWg1xfDjvZDVNfgTV/b95g304Aty3z13xPXAhHZ3RO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6S1CVnxRbqLe+TZLuVS82m5nRHJT3b5fbD8jquGJOE+e+xT
DgA0XoCpBa6D8yRt0uVDIyxCUsVd5DL0JusN7VehzcUEaZMyuL+CyDeRAoGBAImB
qH6mq3Kc6Komnwlw4ttJ436sxr1vuTKOIyYdZBNB0Zg5PGi+MWU0zl5LDroLi3vl
FwbVGBxcvxkSBU63FHhKMQw7Ne0gii+iQQcYQdtKKpb4ezNS1+exd55WTIcExTgL
tvYZMhgsh8tRgfLWpXor7kWmdBrgeflFiOxZIL1/AoGAeBP7sdE+gzsh8jqFnVRj
7nOg+YllJAlWsf7cTH4pLIy2Eo9D+cNjhL9LK6RaAd7PSZ1adm8HfaROA2cfCm84
RI4c7Ue0G+N6LZiFvC0Bfi5SaPVAExXOty8UqjOCoZavSaXBPuNcTXZuzswcgbxI
G5/kaJNHoEcdlVsPsYWKRNKgPzA9BgorBgEEAZIIEggBMS8wLQYJYIZIAWUDBAIC
BCCK9DKMh7687DHjA7j1U37/y2qR2UcITZmjaYI7NvAUYg==
-----END PRIVATE KEY-----

4. Compatibility Notes πŸ“

For compatibility, it is RECOMMENDED that implementations following this document support generation and validation using the SHA2-384 hash algorithm πŸ’œ

The extension in this doc applies to both the Private-Key Information Syntax Specification (PKCS#8) [RFC5208] and Asymmetric Key Packages [RFC5958] ✨

5. Security Considerations πŸ”₯

All the considerations in [RFC5208] and [RFC5958] apply.

This part is serious, bestie. Those two RFCs have the security details, so go read them before you implement anything 😭

6. IANA Considerations 🌈

This document has no IANA actions ⭐

7. References πŸ“š

7.1. Normative References

7.2. Informative References

Appendix A. ASN.1 Module 🧩

This appendix gives non-normative ASN.1 definitions for the structures in this spec, using ASN.1 as defined in [ITU-T-X680] and [RFC5912] πŸ¦‹

   PrivateKeyValidationAttrV1
     { iso(1) identified-organization(3) dod(6) internet(1)
       private(4) enterprise(1) 2312 18 1 1 }

   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) } ;

   -- PrivateKeyInfo is defined in [RFC5208].
   -- This definition adds the validation parameters attribute
   -- to the set of allowed attributes.

   PrivateKeyInfo ATTRIBUTE ::= {
     at-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 }

   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 πŸ’–

Author's Address πŸŽ€

Nikos Mavrogiannopoulos Red Hat, Inc. Brno Czech Republic

Email: nmav@redhat.com ✨

πŸ“¦ where this page comes from