OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #ifndef WebCryptoKeyAlgorithm_h | 31 #ifndef WebCryptoKeyAlgorithm_h |
32 #define WebCryptoKeyAlgorithm_h | 32 #define WebCryptoKeyAlgorithm_h |
33 | 33 |
34 #include "WebCommon.h" | 34 #include "WebCommon.h" |
35 #include "WebCryptoAlgorithm.h" | 35 #include "WebCryptoAlgorithm.h" |
36 #include "WebCryptoKeyAlgorithmParams.h" | 36 #include "WebCryptoKeyAlgorithmParams.h" |
37 #include "WebPrivatePtr.h" | 37 #include "WebPrivatePtr.h" |
38 | 38 |
39 #if INSIDE_BLINK | 39 #if INSIDE_BLINK |
40 #include <memory> | 40 #include "wtf/PassOwnPtr.h" |
41 #endif | 41 #endif |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
44 | 44 |
45 class WebCryptoKeyAlgorithmPrivate; | 45 class WebCryptoKeyAlgorithmPrivate; |
46 | 46 |
47 // WebCryptoKeyAlgorithm represents the algorithm used to generate a key. | 47 // WebCryptoKeyAlgorithm represents the algorithm used to generate a key. |
48 // * Immutable | 48 // * Immutable |
49 // * Threadsafe | 49 // * Threadsafe |
50 // * Copiable (cheaply) | 50 // * Copiable (cheaply) |
51 class WebCryptoKeyAlgorithm { | 51 class WebCryptoKeyAlgorithm { |
52 public: | 52 public: |
53 WebCryptoKeyAlgorithm() { } | 53 WebCryptoKeyAlgorithm() { } |
54 | 54 |
55 #if INSIDE_BLINK | 55 #if INSIDE_BLINK |
56 BLINK_PLATFORM_EXPORT WebCryptoKeyAlgorithm(WebCryptoAlgorithmId, std::uniqu
e_ptr<WebCryptoKeyAlgorithmParams>); | 56 BLINK_PLATFORM_EXPORT WebCryptoKeyAlgorithm(WebCryptoAlgorithmId, PassOwnPtr
<WebCryptoKeyAlgorithmParams>); |
57 #endif | 57 #endif |
58 | 58 |
59 // FIXME: Delete this in favor of the create*() functions. | 59 // FIXME: Delete this in favor of the create*() functions. |
60 BLINK_PLATFORM_EXPORT static WebCryptoKeyAlgorithm adoptParamsAndCreate(WebC
ryptoAlgorithmId, WebCryptoKeyAlgorithmParams*); | 60 BLINK_PLATFORM_EXPORT static WebCryptoKeyAlgorithm adoptParamsAndCreate(WebC
ryptoAlgorithmId, WebCryptoKeyAlgorithmParams*); |
61 | 61 |
62 BLINK_PLATFORM_EXPORT static WebCryptoKeyAlgorithm createAes(WebCryptoAlgori
thmId, unsigned short keyLengthBits); | 62 BLINK_PLATFORM_EXPORT static WebCryptoKeyAlgorithm createAes(WebCryptoAlgori
thmId, unsigned short keyLengthBits); |
63 BLINK_PLATFORM_EXPORT static WebCryptoKeyAlgorithm createHmac(WebCryptoAlgor
ithmId hash, unsigned keyLengthBits); | 63 BLINK_PLATFORM_EXPORT static WebCryptoKeyAlgorithm createHmac(WebCryptoAlgor
ithmId hash, unsigned keyLengthBits); |
64 BLINK_PLATFORM_EXPORT static WebCryptoKeyAlgorithm createRsaHashed(WebCrypto
AlgorithmId, unsigned modulusLengthBits, const unsigned char* publicExponent, un
signed publicExponentSize, WebCryptoAlgorithmId hash); | 64 BLINK_PLATFORM_EXPORT static WebCryptoKeyAlgorithm createRsaHashed(WebCrypto
AlgorithmId, unsigned modulusLengthBits, const unsigned char* publicExponent, un
signed publicExponentSize, WebCryptoAlgorithmId hash); |
65 BLINK_PLATFORM_EXPORT static WebCryptoKeyAlgorithm createEc(WebCryptoAlgorit
hmId, WebCryptoNamedCurve); | 65 BLINK_PLATFORM_EXPORT static WebCryptoKeyAlgorithm createEc(WebCryptoAlgorit
hmId, WebCryptoNamedCurve); |
66 BLINK_PLATFORM_EXPORT static WebCryptoKeyAlgorithm createWithoutParams(WebCr
yptoAlgorithmId); | 66 BLINK_PLATFORM_EXPORT static WebCryptoKeyAlgorithm createWithoutParams(WebCr
yptoAlgorithmId); |
(...skipping 27 matching lines...) Expand all Loading... |
94 private: | 94 private: |
95 BLINK_PLATFORM_EXPORT void assign(const WebCryptoKeyAlgorithm& other); | 95 BLINK_PLATFORM_EXPORT void assign(const WebCryptoKeyAlgorithm& other); |
96 BLINK_PLATFORM_EXPORT void reset(); | 96 BLINK_PLATFORM_EXPORT void reset(); |
97 | 97 |
98 WebPrivatePtr<WebCryptoKeyAlgorithmPrivate> m_private; | 98 WebPrivatePtr<WebCryptoKeyAlgorithmPrivate> m_private; |
99 }; | 99 }; |
100 | 100 |
101 } // namespace blink | 101 } // namespace blink |
102 | 102 |
103 #endif | 103 #endif |
OLD | NEW |