Index: public/platform/WebCryptoAlgorithm.h |
diff --git a/public/platform/WebCryptoAlgorithm.h b/public/platform/WebCryptoAlgorithm.h |
index 0a8e9b49c2d67ad6b5008af39e38771e1239afee..253c3265270ab00d8af4a467ea519121abf192f4 100644 |
--- a/public/platform/WebCryptoAlgorithm.h |
+++ b/public/platform/WebCryptoAlgorithm.h |
@@ -85,6 +85,19 @@ enum WebCryptoAlgorithmParamsType { |
WebCryptoAlgorithmParamsTypeAesCtrParams, |
}; |
+struct WebCryptoAlgorithmInfo { |
+ typedef char ParamsTypeOrUndefined; |
+ static const ParamsTypeOrUndefined Undefined = -1; |
+ |
+ // The canonical (case-sensitive) name for the algorithm. |
+ const char* name; |
+ |
+ // A map from the operation to the expected parameter type of the algorithm. |
+ // If an operation is not applicable for the algorithm, set to Undefined. |
+ const ParamsTypeOrUndefined operationToParamsType[WebCryptoOperationLast + 1]; |
+}; |
+ |
+ |
class WebCryptoAesCbcParams; |
class WebCryptoAesKeyGenParams; |
class WebCryptoHmacImportParams; |
@@ -115,6 +128,16 @@ public: |
BLINK_PLATFORM_EXPORT static WebCryptoAlgorithm createNull(); |
BLINK_PLATFORM_EXPORT static WebCryptoAlgorithm adoptParamsAndCreate(WebCryptoAlgorithmId, WebCryptoAlgorithmParams*); |
+ // Returns a WebCryptoAlgorithmInfo for the algorithm with the given ID. If |
+ // the ID is invalid, return 0. The caller can assume the pointer will be |
+ // valid for the program's entire runtime. |
+ BLINK_PLATFORM_EXPORT static const WebCryptoAlgorithmInfo* lookupAlgorithmInfo(WebCryptoAlgorithmId); |
+ |
+ // Returns the canonical (case-sensitive) name for the algorithm with the |
+ // given ID as a null-terminated C-string literal. Caller can assume the |
+ // pointer will be valid for the program's entire runtime. |
+ BLINK_PLATFORM_EXPORT static const char* idToName(WebCryptoAlgorithmId); |
+ |
~WebCryptoAlgorithm() { reset(); } |
WebCryptoAlgorithm(const WebCryptoAlgorithm& other) { assign(other); } |