Title: [159068] trunk/Source/WebCore
Revision
159068
Author
[email protected]
Date
2013-11-11 13:20:20 -0800 (Mon, 11 Nov 2013)

Log Message

Support WebCrypto KeyPair interface
https://bugs.webkit.org/show_bug.cgi?id=124161

Reviewed by Geoffrey Garen.

No new tests yet, will be tested once generateKey is implemented for any RSA algorithms.

* CMakeLists.txt:
* DerivedSources.make:
* GNUmakefile.list.am:
* WebCore.xcodeproj/project.pbxproj:
Added new files.

* bindings/js/JSDOMPromise.h: Support returning a key pair via a promise.

* bindings/js/JSCryptoKeyPairCustom.cpp: Added.
(WebCore::JSCryptoKeyPair::visitChildren):
* crypto/CryptoKey.idl:
CryptoKey wrapper is reachable through KeyPair, but it doesn't have (or need)
a back pointer.

* crypto/CryptoKeyPair.cpp: Added.
(WebCore::CryptoKeyPair::CryptoKeyPair):
(WebCore::CryptoKeyPair::~CryptoKeyPair):
* crypto/CryptoKeyPair.h: Added.
(WebCore::CryptoKeyPair::create):
(WebCore::CryptoKeyPair::publicKey):
(WebCore::CryptoKeyPair::privateKey):
* crypto/CryptoKeyPair.idl: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (159067 => 159068)


--- trunk/Source/WebCore/CMakeLists.txt	2013-11-11 21:09:16 UTC (rev 159067)
+++ trunk/Source/WebCore/CMakeLists.txt	2013-11-11 21:20:20 UTC (rev 159068)
@@ -281,6 +281,7 @@
     Modules/websockets/WebSocket.idl
 
     crypto/CryptoKey.idl
+    crypto/CryptoKeyPair.idl
     crypto/SubtleCrypto.idl
 
     css/CSSCharsetRule.idl

Modified: trunk/Source/WebCore/ChangeLog (159067 => 159068)


--- trunk/Source/WebCore/ChangeLog	2013-11-11 21:09:16 UTC (rev 159067)
+++ trunk/Source/WebCore/ChangeLog	2013-11-11 21:20:20 UTC (rev 159068)
@@ -1,3 +1,35 @@
+2013-11-11  Alexey Proskuryakov  <[email protected]>
+
+        Support WebCrypto KeyPair interface
+        https://bugs.webkit.org/show_bug.cgi?id=124161
+
+        Reviewed by Geoffrey Garen.
+
+        No new tests yet, will be tested once generateKey is implemented for any RSA algorithms.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * GNUmakefile.list.am:
+        * WebCore.xcodeproj/project.pbxproj:
+        Added new files.
+
+        * bindings/js/JSDOMPromise.h: Support returning a key pair via a promise.
+
+        * bindings/js/JSCryptoKeyPairCustom.cpp: Added.
+        (WebCore::JSCryptoKeyPair::visitChildren):
+        * crypto/CryptoKey.idl:
+        CryptoKey wrapper is reachable through KeyPair, but it doesn't have (or need)
+        a back pointer.
+
+        * crypto/CryptoKeyPair.cpp: Added.
+        (WebCore::CryptoKeyPair::CryptoKeyPair):
+        (WebCore::CryptoKeyPair::~CryptoKeyPair):
+        * crypto/CryptoKeyPair.h: Added.
+        (WebCore::CryptoKeyPair::create):
+        (WebCore::CryptoKeyPair::publicKey):
+        (WebCore::CryptoKeyPair::privateKey):
+        * crypto/CryptoKeyPair.idl: Added.
+
 2013-11-11  Nick Diego Yamane  <[email protected]>
 
         Fix build after r158967

Modified: trunk/Source/WebCore/DerivedSources.make (159067 => 159068)


--- trunk/Source/WebCore/DerivedSources.make	2013-11-11 21:09:16 UTC (rev 159067)
+++ trunk/Source/WebCore/DerivedSources.make	2013-11-11 21:20:20 UTC (rev 159068)
@@ -199,6 +199,7 @@
     $(WebCore)/Modules/websockets/CloseEvent.idl \
     $(WebCore)/Modules/websockets/WebSocket.idl \
     $(WebCore)/crypto/CryptoKey.idl \
+    $(WebCore)/crypto/CryptoKeyPair.idl \
     $(WebCore)/crypto/SubtleCrypto.idl \
     $(WebCore)/css/CSSCharsetRule.idl \
     $(WebCore)/css/CSSFontFaceLoadEvent.idl \

Modified: trunk/Source/WebCore/GNUmakefile.list.am (159067 => 159068)


--- trunk/Source/WebCore/GNUmakefile.list.am	2013-11-11 21:09:16 UTC (rev 159067)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2013-11-11 21:20:20 UTC (rev 159068)
@@ -152,6 +152,8 @@
 	DerivedSources/WebCore/JSCSSValueList.h \
 	DerivedSources/WebCore/JSCryptoKey.cpp \
 	DerivedSources/WebCore/JSCryptoKey.h \
+	DerivedSources/WebCore/JSCryptoKeyPair.cpp \
+	DerivedSources/WebCore/JSCryptoKeyPair.h \
 	DerivedSources/WebCore/JSCustomEvent.cpp \
 	DerivedSources/WebCore/JSCustomEvent.h \
 	DerivedSources/WebCore/JSDatabase.cpp \
@@ -1291,6 +1293,7 @@
 	$(WebCore)/Modules/websockets/CloseEvent.idl \
 	$(WebCore)/Modules/websockets/WebSocket.idl \
 	$(WebCore)/crypto/CryptoKey.idl \
+	$(WebCore)/crypto/CryptoKeyPair.idl \
 	$(WebCore)/crypto/SubtleCrypto.idl \
 	$(WebCore)/css/CSSCharsetRule.idl \
 	$(WebCore)/css/CSSFontFaceLoadEvent.idl \

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (159067 => 159068)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2013-11-11 21:09:16 UTC (rev 159067)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2013-11-11 21:20:20 UTC (rev 159068)
@@ -5698,6 +5698,11 @@
 		E1ED8AC30CC49BE000BFC557 /* CSSPrimitiveValueMappings.h in Headers */ = {isa = PBXBuildFile; fileRef = E1ED8AC20CC49BE000BFC557 /* CSSPrimitiveValueMappings.h */; };
 		E1F1E82F0C3C2BB9006DB391 /* XSLTExtensions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1F1E82D0C3C2BB9006DB391 /* XSLTExtensions.cpp */; };
 		E1F1E8300C3C2BB9006DB391 /* XSLTExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = E1F1E82E0C3C2BB9006DB391 /* XSLTExtensions.h */; };
+		E1F80B8718317252007885C3 /* CryptoKeyPair.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1F80B8518317252007885C3 /* CryptoKeyPair.cpp */; };
+		E1F80B8818317252007885C3 /* CryptoKeyPair.h in Headers */ = {isa = PBXBuildFile; fileRef = E1F80B8618317252007885C3 /* CryptoKeyPair.h */; };
+		E1F80B8A183172A2007885C3 /* JSCryptoKeyPairCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1F80B89183172A2007885C3 /* JSCryptoKeyPairCustom.cpp */; };
+		E1F80B8D183172B5007885C3 /* JSCryptoKeyPair.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1F80B8B183172B5007885C3 /* JSCryptoKeyPair.cpp */; };
+		E1F80B8E183172B5007885C3 /* JSCryptoKeyPair.h in Headers */ = {isa = PBXBuildFile; fileRef = E1F80B8C183172B5007885C3 /* JSCryptoKeyPair.h */; };
 		E1FF57A30F01255B00891EBB /* ThreadGlobalData.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF57A20F01255B00891EBB /* ThreadGlobalData.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E1FF57A60F01256B00891EBB /* ThreadGlobalData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF57A50F01256B00891EBB /* ThreadGlobalData.cpp */; };
 		E1FF8F5F1807442100132674 /* SubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F5D1807442100132674 /* SubtleCrypto.cpp */; };
@@ -12780,6 +12785,12 @@
 		E1ED8AC20CC49BE000BFC557 /* CSSPrimitiveValueMappings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSPrimitiveValueMappings.h; sourceTree = "<group>"; };
 		E1F1E82D0C3C2BB9006DB391 /* XSLTExtensions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XSLTExtensions.cpp; sourceTree = "<group>"; };
 		E1F1E82E0C3C2BB9006DB391 /* XSLTExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XSLTExtensions.h; sourceTree = "<group>"; };
+		E1F80B8418317247007885C3 /* CryptoKeyPair.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CryptoKeyPair.idl; sourceTree = "<group>"; };
+		E1F80B8518317252007885C3 /* CryptoKeyPair.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoKeyPair.cpp; sourceTree = "<group>"; };
+		E1F80B8618317252007885C3 /* CryptoKeyPair.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoKeyPair.h; sourceTree = "<group>"; };
+		E1F80B89183172A2007885C3 /* JSCryptoKeyPairCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoKeyPairCustom.cpp; sourceTree = "<group>"; };
+		E1F80B8B183172B5007885C3 /* JSCryptoKeyPair.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoKeyPair.cpp; sourceTree = "<group>"; };
+		E1F80B8C183172B5007885C3 /* JSCryptoKeyPair.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCryptoKeyPair.h; sourceTree = "<group>"; };
 		E1FF57A20F01255B00891EBB /* ThreadGlobalData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadGlobalData.h; sourceTree = "<group>"; };
 		E1FF57A50F01256B00891EBB /* ThreadGlobalData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadGlobalData.cpp; sourceTree = "<group>"; };
 		E1FF8F5C1807364B00132674 /* SubtleCrypto.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SubtleCrypto.idl; sourceTree = "<group>"; };
@@ -19582,6 +19593,7 @@
 				BCA83E510D7CE205003421A8 /* JSClipboardCustom.cpp */,
 				209B456A16796A7E00E54E4E /* JSCryptoCustom.cpp */,
 				E157A8E618184C67009F821D /* JSCryptoKeyCustom.cpp */,
+				E1F80B89183172A2007885C3 /* JSCryptoKeyPairCustom.cpp */,
 				BC46C1ED0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp */,
 				AD726FE916D9F40A003A4E6D /* JSCSSRuleCustom.h */,
 				9392262E10321084006E7D5D /* JSCSSRuleListCustom.cpp */,
@@ -20485,6 +20497,9 @@
 				E157A8E218173A3A009F821D /* CryptoKey.cpp */,
 				E157A8E318173A3A009F821D /* CryptoKey.h */,
 				E125F85D182C2DF600D84CD9 /* CryptoKeyData.h */,
+				E1F80B8518317252007885C3 /* CryptoKeyPair.cpp */,
+				E1F80B8618317252007885C3 /* CryptoKeyPair.h */,
+				E1F80B8418317247007885C3 /* CryptoKeyPair.idl */,
 				E125F855182C0F8300D84CD9 /* CryptoKeySerialization.h */,
 				E19727151820549E00592D51 /* CryptoKeyType.h */,
 				E172AF6F180F289500FBADB9 /* CryptoKeyUsage.h */,
@@ -20500,6 +20515,8 @@
 			children = (
 				E157A8DE1817331C009F821D /* JSCryptoKey.cpp */,
 				E157A8DF1817331C009F821D /* JSCryptoKey.h */,
+				E1F80B8B183172B5007885C3 /* JSCryptoKeyPair.cpp */,
+				E1F80B8C183172B5007885C3 /* JSCryptoKeyPair.h */,
 				E1FF8F62180745D800132674 /* JSSubtleCrypto.cpp */,
 				E1FF8F63180745D800132674 /* JSSubtleCrypto.h */,
 			);
@@ -22180,6 +22197,7 @@
 				FB3056C2169E5DAC0096A232 /* CSSGroupingRule.h in Headers */,
 				BC772B3C0C4EA91E0083285F /* CSSHelper.h in Headers */,
 				FB49C39D16784947007FFB5D /* CSSHostRule.h in Headers */,
+				E1F80B8E183172B5007885C3 /* JSCryptoKeyPair.h in Headers */,
 				BC23EE920DAED2BC009FDC91 /* CSSImageGeneratorValue.h in Headers */,
 				9393E600151A99F200066F06 /* CSSImageSetValue.h in Headers */,
 				A80E6CFA0A1989CA007FB8C5 /* CSSImageValue.h in Headers */,
@@ -24215,6 +24233,7 @@
 				A8DF4AEF0980C42C0052981B /* RenderTableSection.h in Headers */,
 				BCEA488C097D93020094C9E4 /* RenderText.h in Headers */,
 				AB67D1A9097F3AE300F9392E /* RenderTextControl.h in Headers */,
+				E1F80B8818317252007885C3 /* CryptoKeyPair.h in Headers */,
 				083DAEA70F01A7FB00342754 /* RenderTextControlMultiLine.h in Headers */,
 				083DAEA90F01A7FB00342754 /* RenderTextControlSingleLine.h in Headers */,
 				BCEA488E097D93020094C9E4 /* RenderTextFragment.h in Headers */,
@@ -25844,6 +25863,7 @@
 				85ACA9C10A9B5FA500671E90 /* DOMElement.mm in Sources */,
 				85CA96B90A9621A600690CCF /* DOMEntity.mm in Sources */,
 				85089CDE0A98C42800A275AA /* DOMEntityReference.mm in Sources */,
+				E1F80B8D183172B5007885C3 /* JSCryptoKeyPair.cpp in Sources */,
 				BC1BDF24156C1883001C1243 /* DOMError.cpp in Sources */,
 				85AFA8230AAF528A00E84305 /* DOMEvent.mm in Sources */,
 				BC1A37B3097C715F0019F3D8 /* DOMEvents.mm in Sources */,
@@ -26377,6 +26397,7 @@
 				B885E8D411E06DD2009FFBF4 /* InspectorApplicationCacheAgent.cpp in Sources */,
 				4F707A9911EF679400ACDA69 /* InspectorBackendDispatcher.cpp in Sources */,
 				7AA51B6F1483B61600AD2752 /* InspectorBaseAgent.cpp in Sources */,
+				E1F80B8A183172A2007885C3 /* JSCryptoKeyPairCustom.cpp in Sources */,
 				AAD766EB157E502F00E85423 /* InspectorCanvasAgent.cpp in Sources */,
 				7A1F2B52126C61B20006A7E6 /* InspectorClient.cpp in Sources */,
 				F3335BF812E07DC300D33011 /* InspectorConsoleAgent.cpp in Sources */,
@@ -27475,6 +27496,7 @@
 				FD3160AA12B026F700C1A359 /* ReverbConvolverStage.cpp in Sources */,
 				51D719E9181106E00016DC51 /* IDBPendingTransactionMonitor.cpp in Sources */,
 				FD3160AC12B026F700C1A359 /* ReverbInputBuffer.cpp in Sources */,
+				E1F80B8718317252007885C3 /* CryptoKeyPair.cpp in Sources */,
 				BC74DA381013F3F7007987AD /* RGBColor.cpp in Sources */,
 				A8CFF5E70A155A05000A4234 /* RootInlineBox.cpp in Sources */,
 				49E911C80EF86D47009D0CAF /* RotateTransformOperation.cpp in Sources */,

Copied: trunk/Source/WebCore/bindings/js/JSCryptoKeyPairCustom.cpp (from rev 159067, trunk/Source/WebCore/crypto/CryptoKey.idl) (0 => 159068)


--- trunk/Source/WebCore/bindings/js/JSCryptoKeyPairCustom.cpp	                        (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSCryptoKeyPairCustom.cpp	2013-11-11 21:20:20 UTC (rev 159068)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "JSCryptoKeyPair.h"
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+using namespace JSC;
+
+namespace WebCore {
+
+void JSCryptoKeyPair::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSCryptoKeyPair* thisObject = jsCast<JSCryptoKeyPair*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
+
+    visitor.addOpaqueRoot(thisObject->m_impl->publicKey());
+    visitor.addOpaqueRoot(thisObject->m_impl->privateKey());
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(SUBTLE_CRYPTO)

Modified: trunk/Source/WebCore/bindings/js/JSDOMPromise.h (159067 => 159068)


--- trunk/Source/WebCore/bindings/js/JSDOMPromise.h	2013-11-11 21:09:16 UTC (rev 159067)
+++ trunk/Source/WebCore/bindings/js/JSDOMPromise.h	2013-11-11 21:20:20 UTC (rev 159068)
@@ -27,6 +27,7 @@
 #define JSDOMPromise_h
 
 #include "JSCryptoKey.h"
+#include "JSCryptoKeyPair.h"
 #include "JSDOMBinding.h"
 #include <runtime/JSGlobalObject.h>
 #include <runtime/JSPromise.h>

Modified: trunk/Source/WebCore/crypto/CryptoKey.idl (159067 => 159068)


--- trunk/Source/WebCore/crypto/CryptoKey.idl	2013-11-11 21:09:16 UTC (rev 159067)
+++ trunk/Source/WebCore/crypto/CryptoKey.idl	2013-11-11 21:20:20 UTC (rev 159068)
@@ -42,6 +42,7 @@
 
 [
     Conditional=SUBTLE_CRYPTO,
+    GenerateIsReachable=Impl,
     InterfaceName=Key,
     NoInterfaceObject,
     SkipVTableValidation

Copied: trunk/Source/WebCore/crypto/CryptoKeyPair.cpp (from rev 159067, trunk/Source/WebCore/crypto/CryptoKey.idl) (0 => 159068)


--- trunk/Source/WebCore/crypto/CryptoKeyPair.cpp	                        (rev 0)
+++ trunk/Source/WebCore/crypto/CryptoKeyPair.cpp	2013-11-11 21:20:20 UTC (rev 159068)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CryptoKeyPair.h"
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+namespace WebCore {
+
+CryptoKeyPair::CryptoKeyPair(PassRefPtr<CryptoKey> publicKey, PassRefPtr<CryptoKey> privateKey)
+    : m_publicKey(publicKey)
+    , m_privateKey(privateKey)
+{
+}
+
+CryptoKeyPair::~CryptoKeyPair()
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(SUBTLE_CRYPTO)

Copied: trunk/Source/WebCore/crypto/CryptoKeyPair.h (from rev 159067, trunk/Source/WebCore/crypto/CryptoKey.idl) (0 => 159068)


--- trunk/Source/WebCore/crypto/CryptoKeyPair.h	                        (rev 0)
+++ trunk/Source/WebCore/crypto/CryptoKeyPair.h	2013-11-11 21:20:20 UTC (rev 159068)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CryptoKeyPair_h
+#define CryptoKeyPair_h
+
+#include "CryptoKey.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+namespace WebCore {
+
+class CryptoKeyPair : public RefCounted<CryptoKeyPair> {
+public:
+    static PassRefPtr<CryptoKeyPair> create(PassRefPtr<CryptoKey> publicKey, PassRefPtr<CryptoKey> privateKey)
+    {
+        return adoptRef(new CryptoKeyPair(publicKey, privateKey));
+    }
+    ~CryptoKeyPair();
+
+    CryptoKey* publicKey() { return m_publicKey.get(); }
+    CryptoKey* privateKey() { return m_privateKey.get(); }
+
+private:
+    CryptoKeyPair(PassRefPtr<CryptoKey> publicKey, PassRefPtr<CryptoKey> privateKey);
+
+    RefPtr<CryptoKey> m_publicKey;
+    RefPtr<CryptoKey> m_privateKey;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SUBTLE_CRYPTO)
+#endif // CryptoKeyPair_h

Copied: trunk/Source/WebCore/crypto/CryptoKeyPair.idl (from rev 159067, trunk/Source/WebCore/crypto/CryptoKey.idl) (0 => 159068)


--- trunk/Source/WebCore/crypto/CryptoKeyPair.idl	                        (rev 0)
+++ trunk/Source/WebCore/crypto/CryptoKeyPair.idl	2013-11-11 21:20:20 UTC (rev 159068)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=SUBTLE_CRYPTO,
+    ImplementationLacksVTable,
+    InterfaceName=KeyPair,
+    JSCustomMarkFunction,
+    NoInterfaceObject,
+    OperationsNotDeletable
+] interface CryptoKeyPair {
+    readonly attribute CryptoKey publicKey;
+    readonly attribute CryptoKey privateKey;
+};
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to