Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8274151

Java Security Standard Algorithm Names spec should include names of key formats

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 18
    • Component/s: security-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Risk:
      minimal
    • Interface Kind:
      Other
    • Scope:
      SE

      Description

      Summary

      Add names of standard encoding formats for keys such as "X.509", "PKCS#8", and "PKCS#1".

      Problem

      The getFormat method of java.security.Key and java.security.spec.EncodedKeySpec return the name of the format that the key is encoded in. These names should be defined in the Standard Algorithm Names specification for interoperability/compatibility.

      Some of the formats such as "X.509" and "PKCS#8" are defined in the API specification for Key.getFormat, but it would be better to also include them in the Standard Algorithm Names specification.

      Solution

      Add a new section to the specification named "Key Encodings".

      Specification

      +## `Key` Encodings
      +
      +The names of primary encoding formats returned by [Key.getFormat()](
      +../../api/java.base/java/security/Key.html#getFormat()) or
      +[EncodedKeySpec.getFormat()](../../api/java.base/java/security/spec/EncodedKeySpec.html#getFormat()).
      +
      +---------------  --------------------------------------------------------------
      +Encoding         Description
      +---------------  --------------------------------------------------------------
      +PKCS#1           The ASN.1 data format for `RSAPrivateKey` as defined in 
      +                 PKCS #1(https://www.rfc-editor.org/rfc/rfc8017.html).
      +
      +PKCS#8           The ASN.1 data format for `PrivateKeyInfo`, as defined in
      +                 PKCS #8(https://www.rfc-editor.org/rfc/rfc5208.html).
      +
      +RAW              The raw key bytes.
      +
      +X.509            The ASN.1 data format for `SubjectPublicKeyInfo`, as defined by
      +                 X.509, and also specified in
      +                 [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.html).
      +---------------  --------------------------------------------------------------
      +

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mullan Sean Mullan
              Reporter:
              mullan Sean Mullan
              Reviewed By:
              Jamil Nimeh
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: