| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 class WebCryptoAlgorithmPrivate; | 75 class WebCryptoAlgorithmPrivate; |
| 76 | 76 |
| 77 // The WebCryptoAlgorithm represents a normalized algorithm and its parameters. | 77 // The WebCryptoAlgorithm represents a normalized algorithm and its parameters. |
| 78 // * Immutable | 78 // * Immutable |
| 79 // * Threadsafe | 79 // * Threadsafe |
| 80 // * Copiable (cheaply) | 80 // * Copiable (cheaply) |
| 81 class WebCryptoAlgorithm { | 81 class WebCryptoAlgorithm { |
| 82 public: | 82 public: |
| 83 #if WEBKIT_IMPLEMENTATION | 83 #if WEBKIT_IMPLEMENTATION |
| 84 WebCryptoAlgorithm() { } | 84 WebCryptoAlgorithm() { } |
| 85 WebCryptoAlgorithm(WebCryptoAlgorithmId, const char* name, PassOwnPtr<WebCry
ptoAlgorithmParams>); | 85 WebCryptoAlgorithm(WebCryptoAlgorithmId, PassOwnPtr<WebCryptoAlgorithmParams
>); |
| 86 #endif | 86 #endif |
| 87 | 87 |
| 88 WEBKIT_EXPORT static WebCryptoAlgorithm adoptParamsAndCreate(WebCryptoAlgori
thmId, const char* name, WebCryptoAlgorithmParams*); | 88 // FIXME: delete this once no longer used |
| 89 WEBKIT_EXPORT static WebCryptoAlgorithm adoptParamsAndCreate(WebCryptoAlgori
thmId, const char*, WebCryptoAlgorithmParams*); |
| 90 |
| 91 WEBKIT_EXPORT static WebCryptoAlgorithm adoptParamsAndCreate(WebCryptoAlgori
thmId, WebCryptoAlgorithmParams*); |
| 89 | 92 |
| 90 ~WebCryptoAlgorithm() { reset(); } | 93 ~WebCryptoAlgorithm() { reset(); } |
| 91 | 94 |
| 92 WebCryptoAlgorithm(const WebCryptoAlgorithm& other) { assign(other); } | 95 WebCryptoAlgorithm(const WebCryptoAlgorithm& other) { assign(other); } |
| 93 WebCryptoAlgorithm& operator=(const WebCryptoAlgorithm& other) | 96 WebCryptoAlgorithm& operator=(const WebCryptoAlgorithm& other) |
| 94 { | 97 { |
| 95 assign(other); | 98 assign(other); |
| 96 return *this; | 99 return *this; |
| 97 } | 100 } |
| 98 | 101 |
| 99 WEBKIT_EXPORT WebCryptoAlgorithmId id() const; | 102 WEBKIT_EXPORT WebCryptoAlgorithmId id() const; |
| 100 WEBKIT_EXPORT const char* name() const; | |
| 101 | 103 |
| 102 WEBKIT_EXPORT WebCryptoAlgorithmParamsType paramsType() const; | 104 WEBKIT_EXPORT WebCryptoAlgorithmParamsType paramsType() const; |
| 103 | 105 |
| 104 // Retrieves the type-specific parameters. The algorithm contains at most 1 | 106 // Retrieves the type-specific parameters. The algorithm contains at most 1 |
| 105 // type of parameters. Retrieving an invalid parameter will return 0. | 107 // type of parameters. Retrieving an invalid parameter will return 0. |
| 106 WEBKIT_EXPORT WebCryptoAesCbcParams* aesCbcParams() const; | 108 WEBKIT_EXPORT WebCryptoAesCbcParams* aesCbcParams() const; |
| 107 WEBKIT_EXPORT WebCryptoAesKeyGenParams* aesKeyGenParams() const; | 109 WEBKIT_EXPORT WebCryptoAesKeyGenParams* aesKeyGenParams() const; |
| 108 WEBKIT_EXPORT WebCryptoHmacParams* hmacParams() const; | 110 WEBKIT_EXPORT WebCryptoHmacParams* hmacParams() const; |
| 109 WEBKIT_EXPORT WebCryptoHmacKeyParams* hmacKeyParams() const; | 111 WEBKIT_EXPORT WebCryptoHmacKeyParams* hmacKeyParams() const; |
| 110 WEBKIT_EXPORT WebCryptoRsaSsaParams* rsaSsaParams() const; | 112 WEBKIT_EXPORT WebCryptoRsaSsaParams* rsaSsaParams() const; |
| 111 WEBKIT_EXPORT WebCryptoRsaKeyGenParams* rsaKeyGenParams() const; | 113 WEBKIT_EXPORT WebCryptoRsaKeyGenParams* rsaKeyGenParams() const; |
| 112 | 114 |
| 113 private: | 115 private: |
| 114 WEBKIT_EXPORT void assign(const WebCryptoAlgorithm& other); | 116 WEBKIT_EXPORT void assign(const WebCryptoAlgorithm& other); |
| 115 WEBKIT_EXPORT void reset(); | 117 WEBKIT_EXPORT void reset(); |
| 116 | 118 |
| 117 WebPrivatePtr<WebCryptoAlgorithmPrivate> m_private; | 119 WebPrivatePtr<WebCryptoAlgorithmPrivate> m_private; |
| 118 }; | 120 }; |
| 119 | 121 |
| 120 } // namespace WebKit | 122 } // namespace WebKit |
| 121 | 123 |
| 122 #endif | 124 #endif |
| OLD | NEW |