<?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>26214</bug_id>
          
          <creation_ts>2014-06-26 22:32:42 +0000</creation_ts>
          <short_desc>Define consistent error when calling exportKey() with unsupported key format</short_desc>
          <delta_ts>2014-09-26 00:46:18 +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>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Eric Roman">ericroman</reporter>
          <assigned_to name="Ryan Sleevi">sleevi</assigned_to>
          <cc>public-webcrypto</cc>
    
    <cc>watsonm</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>108404</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Roman">ericroman</who>
    <bug_when>2014-06-26 22:32:42 +0000</bug_when>
    <thetext>When calling importKey() with a &quot;format&quot; that is not applicable to the algorith, the spec says to return a NotSupportedError.

So I would expect when calling exportKey() with a format that is not applicable for the key&apos;s algorithm, to similarly return a NotSupportedError.

However as currently written there are per-algorithm inconsistencies:

  * The RSA and EC keys define it as returning NotSupported
  * AES-GCM defines it as DataError
  * AES-CTR leaves it undefined
  * AES-CBC leaves it undefined
  * AES-CMAC leaves it undefined

Proposal: Fail with NotSupportedError in all cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111955</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Watson">watsonm</who>
    <bug_when>2014-09-22 17:54:14 +0000</bug_when>
    <thetext>I agree with the proposal to always use NotSupportedError in this case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112229</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Watson">watsonm</who>
    <bug_when>2014-09-26 00:46:18 +0000</bug_when>
    <thetext>https://dvcs.w3.org/hg/webcrypto-api/rev/5b2b1e7a8d4c
https://dvcs.w3.org/hg/webcrypto-api/rev/939143e3319f</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>