• ap@apple.com's avatar
    Implement raw format for WebCrypto key export · 32fdefdd
    ap@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=124376
    
    Reviewed by Anders Carlsson.
    
    Source/WebCore: 
    
    Tests: crypto/subtle/aes-export-key.html
           crypto/subtle/hmac-export-key.html
    
    A CryptoKey just exports its native CryptoKeyData, which will also work nicely for
    JWK format soon. For spki and pkcs8, we'll need to figure out the best way to
    utilize platform library support for ASN.1, but we are not there yet.
    
    * bindings/js/JSSubtleCryptoCustom.cpp:
    (WebCore::JSSubtleCrypto::exportKey):
    * crypto/CryptoKey.h:
    * crypto/SubtleCrypto.idl:
    * crypto/keys/CryptoKeyAES.cpp:
    (WebCore::CryptoKeyAES::exportData):
    * crypto/keys/CryptoKeyAES.h:
    * crypto/keys/CryptoKeyHMAC.cpp:
    (WebCore::CryptoKeyHMAC::exportData):
    * crypto/keys/CryptoKeyHMAC.h:
    
    * crypto/keys/CryptoKeyRSA.h:
    * crypto/mac/CryptoKeyRSAMac.cpp:
    (WebCore::CryptoKeyRSA::exportData):
    Added a dummy implementation for RSA.
    
    LayoutTests: 
    
    * crypto/subtle/aes-export-key-expected.txt: Added.
    * crypto/subtle/aes-export-key.html: Added.
    * crypto/subtle/hmac-export-key-expected.txt: Added.
    * crypto/subtle/hmac-export-key.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159310 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    32fdefdd
hmac-export-key.html 1.13 KB