OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 25 matching lines...) Expand all Loading... |
36 | 36 |
37 #if WEBKIT_IMPLEMENTATION | 37 #if WEBKIT_IMPLEMENTATION |
38 #include "wtf/PassOwnPtr.h" | 38 #include "wtf/PassOwnPtr.h" |
39 #endif | 39 #endif |
40 | 40 |
41 namespace WebKit { | 41 namespace WebKit { |
42 | 42 |
43 enum WebCryptoAlgorithmId { | 43 enum WebCryptoAlgorithmId { |
44 WebCryptoAlgorithmIdAesCbc, | 44 WebCryptoAlgorithmIdAesCbc, |
45 WebCryptoAlgorithmIdHmac, | 45 WebCryptoAlgorithmIdHmac, |
| 46 WebCryptoAlgorithmIdRsaSsaPkcs1v1_5, |
46 WebCryptoAlgorithmIdSha1, | 47 WebCryptoAlgorithmIdSha1, |
47 WebCryptoAlgorithmIdSha224, | 48 WebCryptoAlgorithmIdSha224, |
48 WebCryptoAlgorithmIdSha256, | 49 WebCryptoAlgorithmIdSha256, |
49 WebCryptoAlgorithmIdSha384, | 50 WebCryptoAlgorithmIdSha384, |
50 WebCryptoAlgorithmIdSha512, | 51 WebCryptoAlgorithmIdSha512, |
51 #if WEBKIT_IMPLEMENTATION | 52 #if WEBKIT_IMPLEMENTATION |
52 NumberOfWebCryptoAlgorithmId, | 53 NumberOfWebCryptoAlgorithmId, |
53 #endif | 54 #endif |
54 }; | 55 }; |
55 | 56 |
56 enum WebCryptoAlgorithmParamsType { | 57 enum WebCryptoAlgorithmParamsType { |
57 WebCryptoAlgorithmParamsTypeNone, | 58 WebCryptoAlgorithmParamsTypeNone, |
58 WebCryptoAlgorithmParamsTypeAesCbcParams, | 59 WebCryptoAlgorithmParamsTypeAesCbcParams, |
59 WebCryptoAlgorithmParamsTypeAesKeyGenParams, | 60 WebCryptoAlgorithmParamsTypeAesKeyGenParams, |
60 WebCryptoAlgorithmParamsTypeHmacParams, | 61 WebCryptoAlgorithmParamsTypeHmacParams, |
| 62 WebCryptoAlgorithmParamsTypeRsaSsaParams, |
| 63 WebCryptoAlgorithmParamsTypeRsaKeyGenParams, |
61 }; | 64 }; |
62 | 65 |
63 class WebCryptoAesCbcParams; | 66 class WebCryptoAesCbcParams; |
64 class WebCryptoAesKeyGenParams; | 67 class WebCryptoAesKeyGenParams; |
65 class WebCryptoHmacParams; | 68 class WebCryptoHmacParams; |
| 69 class WebCryptoRsaSsaParams; |
| 70 class WebCryptoRsaKeyGenParams; |
66 | 71 |
67 class WebCryptoAlgorithmParams; | 72 class WebCryptoAlgorithmParams; |
68 class WebCryptoAlgorithmPrivate; | 73 class WebCryptoAlgorithmPrivate; |
69 | 74 |
70 // The WebCryptoAlgorithm represents a normalized algorithm and its parameters. | 75 // The WebCryptoAlgorithm represents a normalized algorithm and its parameters. |
71 // * Immutable | 76 // * Immutable |
72 // * Threadsafe | 77 // * Threadsafe |
73 // * Copiable (cheaply) | 78 // * Copiable (cheaply) |
74 class WebCryptoAlgorithm { | 79 class WebCryptoAlgorithm { |
75 public: | 80 public: |
(...skipping 16 matching lines...) Expand all Loading... |
92 WEBKIT_EXPORT WebCryptoAlgorithmId id() const; | 97 WEBKIT_EXPORT WebCryptoAlgorithmId id() const; |
93 WEBKIT_EXPORT const char* name() const; | 98 WEBKIT_EXPORT const char* name() const; |
94 | 99 |
95 WEBKIT_EXPORT WebCryptoAlgorithmParamsType paramsType() const; | 100 WEBKIT_EXPORT WebCryptoAlgorithmParamsType paramsType() const; |
96 | 101 |
97 // Retrieves the type-specific parameters. The algorithm contains at most 1 | 102 // Retrieves the type-specific parameters. The algorithm contains at most 1 |
98 // type of parameters. Retrieving an invalid parameter will return 0. | 103 // type of parameters. Retrieving an invalid parameter will return 0. |
99 WEBKIT_EXPORT WebCryptoAesCbcParams* aesCbcParams() const; | 104 WEBKIT_EXPORT WebCryptoAesCbcParams* aesCbcParams() const; |
100 WEBKIT_EXPORT WebCryptoAesKeyGenParams* aesKeyGenParams() const; | 105 WEBKIT_EXPORT WebCryptoAesKeyGenParams* aesKeyGenParams() const; |
101 WEBKIT_EXPORT WebCryptoHmacParams* hmacParams() const; | 106 WEBKIT_EXPORT WebCryptoHmacParams* hmacParams() const; |
| 107 WEBKIT_EXPORT WebCryptoRsaSsaParams* rsaSsaParams() const; |
| 108 WEBKIT_EXPORT WebCryptoRsaKeyGenParams* rsaKeyGenParams() const; |
102 | 109 |
103 private: | 110 private: |
104 WEBKIT_EXPORT void assign(const WebCryptoAlgorithm& other); | 111 WEBKIT_EXPORT void assign(const WebCryptoAlgorithm& other); |
105 WEBKIT_EXPORT void reset(); | 112 WEBKIT_EXPORT void reset(); |
106 | 113 |
107 WebPrivatePtr<WebCryptoAlgorithmPrivate> m_private; | 114 WebPrivatePtr<WebCryptoAlgorithmPrivate> m_private; |
108 }; | 115 }; |
109 | 116 |
110 } // namespace WebKit | 117 } // namespace WebKit |
111 | 118 |
112 #endif | 119 #endif |
OLD | NEW |