Skip to content

Commit 3298de5

Browse files
author
d.shubin
committed
Add GetMyCertificates
1 parent 1dc0719 commit 3298de5

8 files changed

+2551
-0
lines changed
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package Diadoc.Api.Proto.Certificates;
2+
3+
message CertificateInfoV2 {
4+
required string Thumbprint = 1;
5+
required CertificateType Type = 2;
6+
optional sfixed64 ValidFrom = 3;
7+
optional sfixed64 ValidTo = 4;
8+
optional sfixed64 PrivateKeyValidFrom = 5;
9+
optional sfixed64 PrivateKeyValidTo = 6;
10+
optional string OrganizationName = 7;
11+
optional string Inn = 8;
12+
optional string UserFirstName = 9;
13+
optional string UserMiddleName = 10;
14+
optional string UserLastName = 11;
15+
optional string UserShortName = 12;
16+
optional bool IsDefault = 13;
17+
}
18+
19+
enum CertificateType {
20+
Unknown = 0;
21+
Token = 1;
22+
Dss = 2;
23+
KonturCertificate = 3;
24+
}
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import "Certificates/CertificateInfoV2.proto";
2+
package Diadoc.Api.Proto.Certificates;
3+
4+
message CertificateList {
5+
repeated CertificateInfoV2 Certificates = 1;
6+
}

src/DiadocApi.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,14 @@ Diadoc::Api::Proto::UserV2 DiadocApi::UpdateMyUser(Diadoc::Api::Proto::Users::Us
14091409
return FromProtoBytes<Diadoc::Api::Proto::UserV2>(PerformHttpRequest(L"/UpdateMyUser", ToProtoBytes(userToUpdate), POST));
14101410
}
14111411

1412+
Diadoc::Api::Proto::CertificateList DiadocApi::GetMyCertificates(const std::wstring& boxId)
1413+
{
1414+
WppTraceDebugOut("GetMyCertificates...");
1415+
std::wstringstream buf;
1416+
buf << L"/GetMyCertificates?boxId=" << StringHelper::CanonicalizeUrl(boxId);
1417+
return FromProtoBytes<Diadoc::Api::Proto::CertificateList>(PerformHttpRequest(buf.str(), GET));
1418+
}
1419+
14121420
Diadoc::Api::Proto::Departments::Department DiadocApi::GetDepartmentByFullId(const std::wstring& boxId, const std::wstring& departmentId)
14131421
{
14141422
WppTraceDebugOut("GetDepartmentByFullId...");

src/DiadocApi.h

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
#include "protos\AcquireCounteragent.pb.h"
5555
#include "protos\CustomPrintFormDetection.pb.h"
5656
#include "protos\Registration\RegistrationRequest.pb.h"
57+
#include "protos\CertificateList.pb.h"
5758
#include "DocumentFilter.h"
5859
#include "HttpSession.h"
5960
#include "TaskResult.h"
@@ -270,6 +271,7 @@ class DiadocApi
270271
Diadoc::Api::Proto::User GetMyUser();
271272
Diadoc::Api::Proto::UserV2 GetMyUserV2();
272273
Diadoc::Api::Proto::UserV2 UpdateMyUser(Diadoc::Api::Proto::Users::UserToUpdate& userToUpdate);
274+
Diadoc::Api::Proto::CertificateList GetMyCertificates(const std::wstring& boxId);
273275

274276
Diadoc::Api::Proto::Departments::Department GetDepartmentByFullId(const std::wstring& boxId, const std::wstring& departmentId);
275277
Diadoc::Api::Proto::Departments::DepartmentList GetDepartments(const std::wstring& boxId, int* page = NULL, int* count = NULL);

0 commit comments

Comments
 (0)