<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>24759</bug_id>
          
          <creation_ts>2014-02-21 01:08:20 +0000</creation_ts>
          <short_desc>Importing self-identifying keys</short_desc>
          <delta_ts>2014-03-13 02:22:58 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Web Cryptography</product>
          <component>Web Cryptography API Document</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Watson">watsonm</reporter>
          <assigned_to name="Ryan Sleevi">sleevi</assigned_to>
          <cc>ap</cc>
    
    <cc>ericroman</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>101082</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Watson">watsonm</who>
    <bug_when>2014-02-21 01:08:20 +0000</bug_when>
    <thetext>Presently, the algorithm whose import key operation is executed when importKey is called is determined entirely by the &quot;algorithm&quot; parameter to that method.

For JWK, it would in theory be possible to support:

P = crypto.subtle.importKey( &quot;jwk&quot;, jwk, null, true, [ &lt;usages&gt; ] )

and have the correct algorithm determined by the &quot;alg&quot; member of the JWK.

Do we want to support this ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101085</commentid>
    <comment_count>1</comment_count>
    <who name="Ryan Sleevi">sleevi</who>
    <bug_when>2014-02-21 02:10:23 +0000</bug_when>
    <thetext>Do we want to support this?

No.

SPKI is equally possible that it CAN be self-describing, but it is not GUARANTEED to be self-describing.

&quot;alg&quot; is OPTIONAL in JWK. All that matters is kty.

The API should ALWAYS require to specify the algorithm.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102285</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Roman">ericroman</who>
    <bug_when>2014-03-13 01:35:20 +0000</bug_when>
    <thetext>If support for self-identifying JWK keys is not expected, then can we change the inputs to importKey() and unwrapKey() to make all parameters required?

Currently:

  Promise&lt;any&gt; importKey(KeyFormat format,
                         CryptoOperationData keyData,
                         AlgorithmIdentifier? algorithm,
                         boolean extractable,
                         KeyUsage[] keyUsages );

  Promise&lt;any&gt; unwrapKey(KeyFormat format,
                         CryptoOperationData wrappedKey,
                         Key unwrappingKey,
                         AlgorithmIdentifier unwrapAlgorithm,
                         AlgorithmIdentifier? unwrappedKeyAlgorithm,
                         boolean extractable,
                         KeyUsage[] keyUsages );

In particular, I am proposing the removal of the questionmark (nullable).

Cheers</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102287</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Watson">watsonm</who>
    <bug_when>2014-03-13 02:22:58 +0000</bug_when>
    <thetext>Eric, you are right. I filed Bug 25036.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>