You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Запрос для получения данных в формате Base64.

URL-адрес запроса

https://ccs-dev-api.cipher.kiev.ua/ccs/hash/api/v1/context/{contextId}/verifier/data

Метод

GET

Параметры запроса
contextIdStringfalseИдентификатор сессии
Настраиваемые заголовки запроса

Отсутствует

Ответ
Код ответаContent-typeДопустимые параметрыПример содержимого
200application/json

valid
verifiedHash
calculatedHash
algorithm


{
"valid": true,
"verifiedHash": "jabeLG+ohrhz1q6Se04wTYHkUz5XymHj0tttzSwXm2s=",
"calculatedHash": "jabeLG+ohrhz1q6Se04wTYHkUz5XymHj0tttzSwXm2s=",
"algorithm": "GOST3411"
}
400, 500application/json

message
code
techMessage

{
"message": "Контексту операції не існує",
"code": "CCSCLIB-5",
"techMessage": ""
}
Параметры JSON объекта ответа

Имя

Тип

Обязательность

Допустимые значения

validBooleantrue

True - хеш действителен

false - хеш недействителен

verifiedHash

Array[Integer]

trueХеш, который был получен для проверки.
calculatedHash

Array[Integer]

trueХэш, который рассчитывается.
algorithmStringtrue

Хеш-алгоритм.

Должен быть одним из [SHA1, SHA224, SHA256, SHA384, SHA512, SHA512256, SHA512224, GOST3411, DSTU7564256, DSTU7564384, DSTU7564512].


Пример кода на JavaScript + jQuery 2.2.4

$.ajax({
    url: "https://localhost:9092/api/v1/ticket/79343564-147f-4a2a-ac2a-182d7a55f802/ds/base64SignedData",
    type: "GET",
    dataType: "json",
    cache: false
}).done(function (jsonResponse, textStatus, xhr) {
    dsData = jsonResponse.base64Data;
    message = "Подписанные данные успешно получены.";
}).fail(function (xhr) {
    try {
        var jsonResponse = JSON.parse(xhr.responseText);
        message = jsonResponse.message;
    } catch (e) {
        message = (xhr.responseText == undefined) ? "Ошибка при получении подписанных данных." : xhr.responseText;
    }
})


  • No labels