1. 04 Dec, 2013 1 commit
    • ap@apple.com's avatar
      Update WebCrypto JWK mapping to newer proposal · e6074e79
      ap@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=124218
      
      Reviewed by Anders Carlsson.
      
      Source/WebCore: 
      
      Tests: crypto/subtle/jwk-export-use-values.html
             crypto/subtle/jwk-import-use-values.html
      
      1. "extractable" renamed to "ext" in JWK.
      2. New values for "use" mapping, which can now be combined into comma separated lists,
      and cover all possible WebCrypto usages.
      
      * bindings/js/JSCryptoKeySerializationJWK.cpp:
      (WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
      (WebCore::JSCryptoKeySerializationJWK::reconcileExtractable):
      (WebCore::JSCryptoKeySerializationJWK::addJWKAlgorithmToJSON):
      (WebCore::processUseValue):
      (WebCore::JSCryptoKeySerializationJWK::addJWKUseToJSON):
      (WebCore::JSCryptoKeySerializationJWK::serialize):
      
      LayoutTests: 
      
      * crypto/subtle/jwk-export-use-values-expected.txt: Added.
      * crypto/subtle/jwk-export-use-values.html: Added.
      * crypto/subtle/jwk-import-use-values-expected.txt: Added.
      * crypto/subtle/jwk-import-use-values.html: Added.
      New tests for "use" mapping.
      
      * crypto/subtle/aes-cbc-import-jwk.html:
      * crypto/subtle/aes-cbc-unwrap-rsa.html:
      * crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html:
      * crypto/subtle/aes-cbc-wrap-rsa.html:
      * crypto/subtle/aes-export-key-expected.txt:
      * crypto/subtle/aes-export-key.html:
      * crypto/subtle/hmac-export-key-expected.txt:
      * crypto/subtle/hmac-export-key.html:
      * crypto/subtle/hmac-import-jwk.html:
      * crypto/subtle/import-jwk-expected.txt:
      * crypto/subtle/import-jwk.html:
      * crypto/subtle/rsa-export-key-expected.txt:
      * crypto/subtle/rsa-export-key.html:
      * crypto/subtle/rsa-export-private-key-expected.txt:
      * crypto/subtle/rsa-export-private-key.html:
      * crypto/subtle/rsa-oaep-key-manipulation-expected.txt:
      * crypto/subtle/rsa-oaep-key-manipulation.html:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e6074e79
  2. 18 Nov, 2013 1 commit
    • ap@apple.com's avatar
      Support exporting public RSASSA-PKCS1-v1_5 keys · a7a1d44a
      ap@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=124475
      
      Reviewed by Sam Weinig.
      
      Source/WebCore: 
      
      Test: crypto/subtle/rsa-export-key.html
      
      * bindings/js/JSCryptoKeySerializationJWK.h:
      * bindings/js/JSCryptoKeySerializationJWK.cpp:
      (WebCore::JSCryptoKeySerializationJWK::buildJSONForRSAComponents):
      (WebCore::JSCryptoKeySerializationJWK::addJWKAlgorithmToJSON):
      (WebCore::JSCryptoKeySerializationJWK::serialize):
      Added said support (this part works with private keys too).
      
      * crypto/keys/CryptoKeyRSA.h:
      * crypto/mac/CryptoKeyRSAMac.cpp:
      (WebCore::CryptoKeyRSA::getPublicKeyComponents): Moved the logic for getting a
      public key from private one here for reuse in keySizeInBits().
      (WebCore::CryptoKeyRSA::isRestrictedToHash):
      (WebCore::CryptoKeyRSA::keySizeInBits):
      (WebCore::CryptoKeyRSA::exportData):
      Exposed information necessary for JWK serialization.
      
      LayoutTests: 
      
      * crypto/subtle/rsa-export-key-expected.txt: Added.
      * crypto/subtle/rsa-export-key.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159403 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a7a1d44a