WebCryptoAlgorithm normalizeCryptoAlgorithm(v8::Local<v8::Object> algorithmObject, WebCryptoOperation operation, int* exceptionCode, WebString* errorDetails, v8::Isolate* isolate)
{
    // FIXME: Avoid using NonThrowableExceptionState.
    NonThrowableExceptionState exceptionState;
    Dictionary algorithmDictionary(algorithmObject, isolate, exceptionState);
    if (!algorithmDictionary.isUndefinedOrNull() && !algorithmDictionary.isObject())
        return WebCryptoAlgorithm();
    WebCryptoAlgorithm algorithm;
    AlgorithmError error;
    AlgorithmIdentifier algorithmIdentifier;
    algorithmIdentifier.setDictionary(algorithmDictionary);
    if (!normalizeAlgorithm(algorithmIdentifier, operation, algorithm, &error)) {
        *exceptionCode = webCryptoErrorToExceptionCode(error.errorType);
        *errorDetails = error.errorDetails;
        return WebCryptoAlgorithm();
    }

    return algorithm;
}
WebCryptoAlgorithm WebCryptoAlgorithm::adoptParamsAndCreate(WebCryptoAlgorithmId id, const char* name, WebCryptoAlgorithmParams* params)
{
    return WebCryptoAlgorithm(id, name, adoptPtr(params));
}
Exemple #3
0
WebCryptoAlgorithm WebCryptoAlgorithm::adoptParamsAndCreate(WebCryptoAlgorithmId id, WebCryptoAlgorithmParams* params)
{
    return WebCryptoAlgorithm(id, adoptPtr(params));
}
Exemple #4
0
WebCryptoAlgorithm WebCryptoAlgorithm::createNull()
{
    return WebCryptoAlgorithm();
}