Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-2160

JOSE encrypt does not produce JWE Header with 'kid'

    XMLWordPrintable

Details

    Description

      Currently when performing

      String encrypted = jose.encrypt("secret message");
      

      The output is a JWE String with header with json format:

      {"alg":"RSA-OAEP","enc":"A256GCM"}
      

      It appears to be missing the 'kid' in the JWE header although it is specified in the configuration as follows:

      swarm:
        jose:
          keystore:
            path: jwk.json
            type: jwk
          encryption:
            key:
              alias: 6IcfnSW2ZN4EQfvRi70N2aFvnT8tqYs4EDMOW_hnyio
            contentAlgorithm: A256GCM
            keyAlgorithm: RSA-OAEP
      

      Perhaps the API could either changed to force the 'kid' to be added so the output is:

      {"alg":"RSA-OAEP","enc":"A256GCM","kid":"6IcfnSW2ZN4EQfvRi70N2aFvnT8tqYs4EDMOW_hnyio"}
      

      Or one could add it as an optional call:

      String encrypted = jose.encrypt("secret message","6IcfnSW2ZN4EQfvRi70N2aFvnT8tqYs4EDMOW_hnyio");
      

      /david

      Attachments

        Activity

          People

            sbiarozk Sergey Beryozkin
            david.dahlin@gmail.com David Dahlin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: