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

PKCS8EncodedKeySpec needs getAlgorithm method

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P5 P5
    • tbd
    • None
    • security-libs
    • None

      The PKCS8EncodedKeySpec class completely obscures the underlying key information forcing applications to "know" what type of key is buried within. This is incongruent relative to the information accessible by the EncryptedPrivateKeyInfo class. That is to say that the EncryptedPrivateKeyInfo class supplies sufficent interface to get back the PKCS8EncodedKeySpec but there is no convenient way to take that key spec and have a KeyFactory mill the PrivateKey. The programming metaphor that should be supported is something along the lines of;

        PKCS8EncodedKeySpec pkcs8Spec ...

        KeyFactory kf = KeyFactory.getInstance(pkcs8Spec.getAlgorithm());
        PrivateKey pk = kf.generatePrivate(pkcs8spec);

            Unassigned Unassigned
            gellisonsunw Gary Ellison (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: