/
certificates.go
2849 lines (1651 loc) · 92.7 KB
/
certificates.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package isegosdk
import (
"fmt"
"strings"
"github.com/go-resty/resty/v2"
"github.com/google/go-querystring/query"
)
type CertificatesService service
type GetCsrsQueryParams struct {
Page int `url:"page,omitempty"` //Page number
Size int `url:"size,omitempty"` //Number of objects returned per page
Sort string `url:"sort,omitempty"` //sort type - asc or desc
SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted
Filter []string `url:"filter,omitempty"` //<div> <style type="text/css" scoped> .apiServiceTable td, .apiServiceTable th { padding: 5px 10px !important; text-align: left; } </style> <span> <b>Simple filtering</b> should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the <i>"filterType=or"</i> query string parameter. Each resource Data model description should specify if an attribute is a filtered field. </span> <br /> <table class="apiServiceTable"> <thead> <tr> <th>OPERATOR</th> <th>DESCRIPTION</th> </tr> </thead> <tbody> <tr> <td>EQ</td> <td>Equals</td> </tr> <tr> <td>NEQ</td> <td>Not Equals</td> </tr> <tr> <td>GT</td> <td>Greater Than</td> </tr> <tr> <td>LT</td> <td>Less Then</td> </tr> <tr> <td>STARTSW</td> <td>Starts With</td> </tr> <tr> <td>NSTARTSW</td> <td>Not Starts With</td> </tr> <tr> <td>ENDSW</td> <td>Ends With</td> </tr> <tr> <td>NENDSW</td> <td>Not Ends With</td> </tr> <tr> <td>CONTAINS</td> <td>Contains</td> </tr> <tr> <td>NCONTAINS</td> <td>Not Contains</td> </tr> </tbody> </table> </div>
FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter
}
type GetSystemCertificatesQueryParams struct {
Page int `url:"page,omitempty"` //Page number
Size int `url:"size,omitempty"` //Number of objects returned per page
Sort string `url:"sort,omitempty"` //sort type - asc or desc
SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted
Filter []string `url:"filter,omitempty"` //<div> <style type="text/css" scoped> .apiServiceTable td, .apiServiceTable th { padding: 5px 10px !important; text-align: left; } </style> <span> <b>Simple filtering</b> should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the <i>"filterType=or"</i> query string parameter. Each resource Data model description should specify if an attribute is a filtered field. </span> <br /> <table class="apiServiceTable"> <thead> <tr> <th>OPERATOR</th> <th>DESCRIPTION</th> </tr> </thead> <tbody> <tr> <td>EQ</td> <td>Equals</td> </tr> <tr> <td>NEQ</td> <td>Not Equals</td> </tr> <tr> <td>GT</td> <td>Greater Than</td> </tr> <tr> <td>LT</td> <td>Less Then</td> </tr> <tr> <td>STARTSW</td> <td>Starts With</td> </tr> <tr> <td>NSTARTSW</td> <td>Not Starts With</td> </tr> <tr> <td>ENDSW</td> <td>Ends With</td> </tr> <tr> <td>NENDSW</td> <td>Not Ends With</td> </tr> <tr> <td>CONTAINS</td> <td>Contains</td> </tr> <tr> <td>NCONTAINS</td> <td>Not Contains</td> </tr> </tbody> </table> </div>
FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter
}
type GetTrustedCertificatesQueryParams struct {
Page int `url:"page,omitempty"` //Page number
Size int `url:"size,omitempty"` //Number of objects returned per page
Sort string `url:"sort,omitempty"` //sort type - asc or desc
SortBy string `url:"sortBy,omitempty"` //sort column by which objects needs to be sorted
Filter []string `url:"filter,omitempty"` //<div> <style type="text/css" scoped> .apiServiceTable td, .apiServiceTable th { padding: 5px 10px !important; text-align: left; } </style> <span> <b>Simple filtering</b> should be available through the filter query string parameter. The structure of a filter is a triplet of field operator and value separated with dots. More than one filter can be sent. The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the <i>"filterType=or"</i> query string parameter. Each resource Data model description should specify if an attribute is a filtered field. </span> <br /> <table class="apiServiceTable"> <thead> <tr> <th>OPERATOR</th> <th>DESCRIPTION</th> </tr> </thead> <tbody> <tr> <td>EQ</td> <td>Equals</td> </tr> <tr> <td>NEQ</td> <td>Not Equals</td> </tr> <tr> <td>GT</td> <td>Greater Than</td> </tr> <tr> <td>LT</td> <td>Less Then</td> </tr> <tr> <td>STARTSW</td> <td>Starts With</td> </tr> <tr> <td>NSTARTSW</td> <td>Not Starts With</td> </tr> <tr> <td>ENDSW</td> <td>Ends With</td> </tr> <tr> <td>NENDSW</td> <td>Not Ends With</td> </tr> <tr> <td>CONTAINS</td> <td>Contains</td> </tr> <tr> <td>NCONTAINS</td> <td>Not Contains</td> </tr> </tbody> </table> </div>
FilterType string `url:"filterType,omitempty"` //The logical operator common to ALL filter criteria will be by default AND, and can be changed by using the parameter
}
type ResponseCertificatesGetCsrs struct {
Response *[]ResponseCertificatesGetCsrsResponse `json:"response,omitempty"` //
NextPage *ResponseCertificatesGetCsrsNextPage `json:"nextPage,omitempty"` //
PreviousPage *ResponseCertificatesGetCsrsPreviousPage `json:"previousPage,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesGetCsrsResponse struct {
FriendlyName string `json:"friendlyName,omitempty"` // Friendly name of the certificate.
GroupTag string `json:"groupTag,omitempty"` // GroupTag of the certificate.
HostName string `json:"hostName,omitempty"` // Hostname or IP address of the ISE node.
ID string `json:"id,omitempty"` // ID of the certificate.
KeySize string `json:"keySize,omitempty"` // Size of the cryptographic key used.
Link *ResponseCertificatesGetCsrsResponseLink `json:"link,omitempty"` //
SignatureAlgorithm string `json:"signatureAlgorithm,omitempty"` // Algorithm used for encrypting CSR
Subject string `json:"subject,omitempty"` // Subject of the certificate. Includes Common Name (CN), Organizational Unit (OU), etc.
TimeStamp string `json:"timeStamp,omitempty"` // Timestamp of the certificate generation.
UsedFor string `json:"usedFor,omitempty"` // Services for which the certificate is used for(for eg- MGMT, GENERIC).
}
type ResponseCertificatesGetCsrsResponseLink struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesGetCsrsNextPage struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesGetCsrsPreviousPage struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesGenerateCsr struct {
Response *[]ResponseCertificatesGenerateCsrResponse `json:"response,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesGenerateCsrResponse struct {
ID string `json:"id,omitempty"` // ID of the generated CSR
Link *ResponseCertificatesGenerateCsrResponseLink `json:"link,omitempty"` //
Message string `json:"message,omitempty"` // Response message on generation of CSR
}
type ResponseCertificatesGenerateCsrResponseLink struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesGenerateIntermediateCaCsr struct {
Response *ResponseCertificatesGenerateIntermediateCaCsrResponse `json:"response,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesGenerateIntermediateCaCsrResponse struct {
ID string `json:"id,omitempty"` // ID of the generated CSR
Link *ResponseCertificatesGenerateIntermediateCaCsrResponseLink `json:"link,omitempty"` //
Message string `json:"message,omitempty"` // Response message on generation of CSR
}
type ResponseCertificatesGenerateIntermediateCaCsrResponseLink struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesGetCsrByID struct {
Response *ResponseCertificatesGetCsrByIDResponse `json:"response,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesGetCsrByIDResponse struct {
CsrContents string `json:"csrContents,omitempty"` // Contents of the certificate file.
FriendlyName string `json:"friendlyName,omitempty"` // Friendly name of the certificate.
GroupTag string `json:"groupTag,omitempty"` // GroupTag of the certificate.
HostName string `json:"hostName,omitempty"` // Hostname or IP address of the ISE node.
ID string `json:"id,omitempty"` // ID of the certificate.
KeySize string `json:"keySize,omitempty"` // Size of the cryptographic key used.
Link *ResponseCertificatesGetCsrByIDResponseLink `json:"link,omitempty"` //
SignatureAlgorithm string `json:"signatureAlgorithm,omitempty"` // Algorithm used for encrypting CSR
Subject string `json:"subject,omitempty"` // Subject of the certificate. Includes Common Name (CN), Organizational Unit (OU), etc.
TimeStamp string `json:"timeStamp,omitempty"` // Timestamp of the certificate generation.
UsedFor string `json:"usedFor,omitempty"` // Services for which the certificate is used for(for eg- MGMT, GENERIC).
}
type ResponseCertificatesGetCsrByIDResponseLink struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesDeleteCsrByID struct {
Response *ResponseCertificatesDeleteCsrByIDResponse `json:"response,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesDeleteCsrByIDResponse struct {
Message string `json:"message,omitempty"` //
}
type ResponseCertificatesRegenerateIseRootCa struct {
Response *ResponseCertificatesRegenerateIseRootCaResponse `json:"response,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesRegenerateIseRootCaResponse struct {
ID string `json:"id,omitempty"` // Id which can be used to track status of ISE root CA chain regeneration
Link *ResponseCertificatesRegenerateIseRootCaResponseLink `json:"link,omitempty"` //
Message string `json:"message,omitempty"` //
}
type ResponseCertificatesRegenerateIseRootCaResponseLink struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesRenewCertificates struct {
Response *ResponseCertificatesRenewCertificatesResponse `json:"response,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesRenewCertificatesResponse struct {
ID string `json:"id,omitempty"` // Id which can be used to track status of certificate regeneration
Link *ResponseCertificatesRenewCertificatesResponseLink `json:"link,omitempty"` //
Message string `json:"message,omitempty"` //
}
type ResponseCertificatesRenewCertificatesResponseLink struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesBindCsr struct {
Response *ResponseCertificatesBindCsrResponse `json:"response,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesBindCsrResponse struct {
Message string `json:"message,omitempty"` //
Status string `json:"status,omitempty"` // Response status after import
}
type ResponseCertificatesImportSystemCertificate struct {
Response *ResponseCertificatesImportSystemCertificateResponse `json:"response,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesImportSystemCertificateResponse struct {
ID string `json:"id,omitempty"` // ID of the imported trust certificate
Message string `json:"message,omitempty"` // Response message on import of system or trust certificate
Status string `json:"status,omitempty"` // HTTP response status after import
}
type ResponseCertificatesGetSystemCertificates struct {
Response *[]ResponseCertificatesGetSystemCertificatesResponse `json:"response,omitempty"` //
NextPage *ResponseCertificatesGetSystemCertificatesNextPage `json:"nextPage,omitempty"` //
PreviousPage *ResponseCertificatesGetSystemCertificatesPreviousPage `json:"previousPage,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesGetSystemCertificatesResponse struct {
ExpirationDate string `json:"expirationDate,omitempty"` // The time and date past which the certificate is no longer valid
FriendlyName string `json:"friendlyName,omitempty"` // Friendly name of system certificate
GroupTag string `json:"groupTag,omitempty"` //
ID string `json:"id,omitempty"` // ID of system certificate
IssuedBy string `json:"issuedBy,omitempty"` // Common Name of the certificate issuer
IssuedTo string `json:"issuedTo,omitempty"` // Common Name of the certificate subject
KeySize *int `json:"keySize,omitempty"` // The length of key used for encrypting system certificate
Link *ResponseCertificatesGetSystemCertificatesResponseLink `json:"link,omitempty"` //
PortalsUsingTheTag string `json:"portalsUsingTheTag,omitempty"` //
SelfSigned *bool `json:"selfSigned,omitempty"` //
SerialNumberDecimalFormat string `json:"serialNumberDecimalFormat,omitempty"` // Used to uniquely identify the certificate within a CA's systems
Sha256Fingerprint string `json:"sha256Fingerprint,omitempty"` //
SignatureAlgorithm string `json:"signatureAlgorithm,omitempty"` //
UsedBy string `json:"usedBy,omitempty"` //
ValidFrom string `json:"validFrom,omitempty"` // The time and date on which the certificate was created, also known as the Not Before certificate attribute
}
type ResponseCertificatesGetSystemCertificatesResponseLink struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesGetSystemCertificatesNextPage struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesGetSystemCertificatesPreviousPage struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesGetSystemCertificateByID struct {
Response *ResponseCertificatesGetSystemCertificateByIDResponse `json:"response,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesGetSystemCertificateByIDResponse struct {
ExpirationDate string `json:"expirationDate,omitempty"` // The time and date past which the certificate is no longer valid
FriendlyName string `json:"friendlyName,omitempty"` // Friendly name of system certificate
GroupTag string `json:"groupTag,omitempty"` //
ID string `json:"id,omitempty"` // ID of system certificate
IssuedBy string `json:"issuedBy,omitempty"` // Common Name of the certificate issuer
IssuedTo string `json:"issuedTo,omitempty"` // Common Name of the certificate subject
KeySize *int `json:"keySize,omitempty"` // The length of key used for encrypting system certificate
Link *ResponseCertificatesGetSystemCertificateByIDResponseLink `json:"link,omitempty"` //
PortalsUsingTheTag string `json:"portalsUsingTheTag,omitempty"` //
SelfSigned *bool `json:"selfSigned,omitempty"` //
SerialNumberDecimalFormat string `json:"serialNumberDecimalFormat,omitempty"` // Used to uniquely identify the certificate within a CA's systems
Sha256Fingerprint string `json:"sha256Fingerprint,omitempty"` //
SignatureAlgorithm string `json:"signatureAlgorithm,omitempty"` //
UsedBy string `json:"usedBy,omitempty"` //
ValidFrom string `json:"validFrom,omitempty"` // The time and date on which the certificate was created, also known as the Not Before certificate attribute
}
type ResponseCertificatesGetSystemCertificateByIDResponseLink struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesUpdateSystemCertificate struct {
Response *ResponseCertificatesUpdateSystemCertificateResponse `json:"response,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesUpdateSystemCertificateResponse struct {
ID string `json:"id,omitempty"` // ID of the imported trust certificate
Link *ResponseCertificatesUpdateSystemCertificateResponseLink `json:"link,omitempty"` //
Message string `json:"message,omitempty"` // Response message on import of system or trust certificate
Status string `json:"status,omitempty"` // HTTP response status after import
}
type ResponseCertificatesUpdateSystemCertificateResponseLink struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesDeleteSystemCertificateByID struct {
Response *ResponseCertificatesDeleteSystemCertificateByIDResponse `json:"response,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesDeleteSystemCertificateByIDResponse struct {
Message string `json:"message,omitempty"` //
}
type ResponseCertificatesGetTrustedCertificates struct {
Response *[]ResponseCertificatesGetTrustedCertificatesResponse `json:"response,omitempty"` //
NextPage *ResponseCertificatesGetTrustedCertificatesNextPage `json:"nextPage,omitempty"` //
PreviousPage *ResponseCertificatesGetTrustedCertificatesPreviousPage `json:"previousPage,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesGetTrustedCertificatesResponse struct {
AuthenticateBeforeCRLReceived string `json:"authenticateBeforeCRLReceived,omitempty"` // Switch to enable/disable authentication before receiving CRL
AutomaticCRLUpdate string `json:"automaticCRLUpdate,omitempty"` // Switch to enable/disable automatic CRL update
AutomaticCRLUpdatePeriod string `json:"automaticCRLUpdatePeriod,omitempty"` // Automatic CRL update period
AutomaticCRLUpdateUnits string `json:"automaticCRLUpdateUnits,omitempty"` // Unit of time of automatic CRL update
CrlDistributionURL string `json:"crlDistributionUrl,omitempty"` // CRL Distribution URL
CrlDownloadFailureRetries string `json:"crlDownloadFailureRetries,omitempty"` // If CRL download fails, wait time before retry
CrlDownloadFailureRetriesUnits string `json:"crlDownloadFailureRetriesUnits,omitempty"` // Unit of time before retry if CRL download fails
Description string `json:"description,omitempty"` // Description of trust certificate
DownloadCRL string `json:"downloadCRL,omitempty"` // Switch to enable/disable download of CRL
EnableOCSpValidation string `json:"enableOCSPValidation,omitempty"` // Switch to enable/disable OCSP Validation
EnableServerIDentityCheck string `json:"enableServerIdentityCheck,omitempty"` // Switch to enable/disable Server Identity Check
ExpirationDate string `json:"expirationDate,omitempty"` // The time and date past which the certificate is no longer valid
FriendlyName string `json:"friendlyName,omitempty"` // Friendly name of trust certificate
ID string `json:"id,omitempty"` // ID of trust certificate
IgnoreCRLExpiration string `json:"ignoreCRLExpiration,omitempty"` // Switch to enable/disable ignore CRL Expiration
InternalCa *bool `json:"internalCA,omitempty"` //
IsReferredInPolicy *bool `json:"isReferredInPolicy,omitempty"` //
IssuedBy string `json:"issuedBy,omitempty"` // The entity that verified the information and signed the certificate
IssuedTo string `json:"issuedTo,omitempty"` // Entity to which trust certificate is issued
KeySize string `json:"keySize,omitempty"` // The length of key used for encrypting trust certificate
Link *ResponseCertificatesGetTrustedCertificatesResponseLink `json:"link,omitempty"` //
NonAutomaticCRLUpdatePeriod string `json:"nonAutomaticCRLUpdatePeriod,omitempty"` // Non automatic CRL update period
NonAutomaticCRLUpdateUnits string `json:"nonAutomaticCRLUpdateUnits,omitempty"` // Unit of time of non automatic CRL update
RejectIfNoStatusFromOCSP string `json:"rejectIfNoStatusFromOCSP,omitempty"` // Switch to reject certificate if there is no status from OCSP
RejectIfUnreachableFromOCSP string `json:"rejectIfUnreachableFromOCSP,omitempty"` // Switch to reject certificate if unreachable from OCSP
SelectedOCSpService string `json:"selectedOCSPService,omitempty"` // Name of selected OCSP Service
SerialNumberDecimalFormat string `json:"serialNumberDecimalFormat,omitempty"` // Used to uniquely identify the certificate within a CA's systems
Sha256Fingerprint string `json:"sha256Fingerprint,omitempty"` //
SignatureAlgorithm string `json:"signatureAlgorithm,omitempty"` // Algorithm used for encrypting trust certificate
Status string `json:"status,omitempty"` //
Subject string `json:"subject,omitempty"` // The Subject or entity with which public key of trust certificate is associated
TrustedFor string `json:"trustedFor,omitempty"` // Different services for which the certificated is trusted
ValidFrom string `json:"validFrom,omitempty"` // The earliest time and date on which the certificate is valid
}
type ResponseCertificatesGetTrustedCertificatesResponseLink struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesGetTrustedCertificatesNextPage struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesGetTrustedCertificatesPreviousPage struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesImportTrustCertificate struct {
Response *ResponseCertificatesImportTrustCertificateResponse `json:"response,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesImportTrustCertificateResponse struct {
ID string `json:"id,omitempty"` // ID of the imported trust certificate
Message string `json:"message,omitempty"` // Response message on import of system or trust certificate
Status string `json:"status,omitempty"` // HTTP response status after import
}
type ResponseCertificatesGetTrustedCertificateByID struct {
Response *ResponseCertificatesGetTrustedCertificateByIDResponse `json:"response,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesGetTrustedCertificateByIDResponse struct {
AuthenticateBeforeCRLReceived string `json:"authenticateBeforeCRLReceived,omitempty"` // Switch to enable/disable authentication before receiving CRL
AutomaticCRLUpdate string `json:"automaticCRLUpdate,omitempty"` // Switch to enable/disable automatic CRL update
AutomaticCRLUpdatePeriod string `json:"automaticCRLUpdatePeriod,omitempty"` // Automatic CRL update period
AutomaticCRLUpdateUnits string `json:"automaticCRLUpdateUnits,omitempty"` // Unit of time of automatic CRL update
CrlDistributionURL string `json:"crlDistributionUrl,omitempty"` // CRL Distribution URL
CrlDownloadFailureRetries string `json:"crlDownloadFailureRetries,omitempty"` // If CRL download fails, wait time before retry
CrlDownloadFailureRetriesUnits string `json:"crlDownloadFailureRetriesUnits,omitempty"` // Unit of time before retry if CRL download fails
Description string `json:"description,omitempty"` // Description of trust certificate
DownloadCRL string `json:"downloadCRL,omitempty"` // Switch to enable/disable download of CRL
EnableOCSpValidation string `json:"enableOCSPValidation,omitempty"` // Switch to enable/disable OCSP Validation
EnableServerIDentityCheck string `json:"enableServerIdentityCheck,omitempty"` // Switch to enable/disable Server Identity Check
ExpirationDate string `json:"expirationDate,omitempty"` // The time and date past which the certificate is no longer valid
FriendlyName string `json:"friendlyName,omitempty"` // Friendly name of trust certificate
ID string `json:"id,omitempty"` // ID of trust certificate
IgnoreCRLExpiration string `json:"ignoreCRLExpiration,omitempty"` // Switch to enable/disable ignore CRL Expiration
InternalCa *bool `json:"internalCA,omitempty"` //
IsReferredInPolicy *bool `json:"isReferredInPolicy,omitempty"` //
IssuedBy string `json:"issuedBy,omitempty"` // The entity that verified the information and signed the certificate
IssuedTo string `json:"issuedTo,omitempty"` // Entity to which trust certificate is issued
KeySize string `json:"keySize,omitempty"` // The length of key used for encrypting trust certificate
Link *ResponseCertificatesGetTrustedCertificateByIDResponseLink `json:"link,omitempty"` //
NonAutomaticCRLUpdatePeriod string `json:"nonAutomaticCRLUpdatePeriod,omitempty"` // Non automatic CRL update period
NonAutomaticCRLUpdateUnits string `json:"nonAutomaticCRLUpdateUnits,omitempty"` // Unit of time of non automatic CRL update
RejectIfNoStatusFromOCSP string `json:"rejectIfNoStatusFromOCSP,omitempty"` // Switch to reject certificate if there is no status from OCSP
RejectIfUnreachableFromOCSP string `json:"rejectIfUnreachableFromOCSP,omitempty"` // Switch to reject certificate if unreachable from OCSP
SelectedOCSpService string `json:"selectedOCSPService,omitempty"` // Name of selected OCSP Service
SerialNumberDecimalFormat string `json:"serialNumberDecimalFormat,omitempty"` // Used to uniquely identify the certificate within a CA's systems
Sha256Fingerprint string `json:"sha256Fingerprint,omitempty"` //
SignatureAlgorithm string `json:"signatureAlgorithm,omitempty"` // Algorithm used for encrypting trust certificate
Status string `json:"status,omitempty"` //
Subject string `json:"subject,omitempty"` // The Subject or entity with which public key of trust certificate is associated
TrustedFor string `json:"trustedFor,omitempty"` // Different services for which the certificated is trusted
ValidFrom string `json:"validFrom,omitempty"` // The earliest time and date on which the certificate is valid
}
type ResponseCertificatesGetTrustedCertificateByIDResponseLink struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesUpdateTrustedCertificate struct {
Response *ResponseCertificatesUpdateTrustedCertificateResponse `json:"response,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesUpdateTrustedCertificateResponse struct {
ID string `json:"id,omitempty"` // ID of the trust certificate
Link *ResponseCertificatesUpdateTrustedCertificateResponseLink `json:"link,omitempty"` //
Message string `json:"message,omitempty"` // Response message on successful update of trust certificate
}
type ResponseCertificatesUpdateTrustedCertificateResponseLink struct {
Href string `json:"href,omitempty"` //
Rel string `json:"rel,omitempty"` //
Type string `json:"type,omitempty"` //
}
type ResponseCertificatesDeleteTrustedCertificateByID struct {
Response *ResponseCertificatesDeleteTrustedCertificateByIDResponse `json:"response,omitempty"` //
Version string `json:"version,omitempty"` //
}
type ResponseCertificatesDeleteTrustedCertificateByIDResponse struct {
Message string `json:"message,omitempty"` //
}
type RequestCertificatesGenerateCsr struct {
AllowWildCardCert *bool `json:"allowWildCardCert,omitempty"` //
CertificatePolicies string `json:"certificatePolicies,omitempty"` //
DigestType string `json:"digestType,omitempty"` //
Hostnames []string `json:"hostnames,omitempty"` //
KeyLength string `json:"keyLength,omitempty"` //
KeyType string `json:"keyType,omitempty"` //
PortalGroupTag string `json:"portalGroupTag,omitempty"` //
SanDNS []string `json:"sanDNS,omitempty"` //
SanDir []string `json:"sanDir,omitempty"` //
SanIP []string `json:"sanIP,omitempty"` //
SanURI []string `json:"sanURI,omitempty"` //
SubjectCity string `json:"subjectCity,omitempty"` //
SubjectCommonName string `json:"subjectCommonName,omitempty"` //
SubjectCountry string `json:"subjectCountry,omitempty"` //
SubjectOrg string `json:"subjectOrg,omitempty"` //
SubjectOrgUnit string `json:"subjectOrgUnit,omitempty"` //
SubjectState string `json:"subjectState,omitempty"` //
UsedFor string `json:"usedFor,omitempty"` //
}
type RequestCertificatesRegenerateIseRootCa struct {
RemoveExistingIseIntermediateCsr *bool `json:"removeExistingISEIntermediateCSR,omitempty"` // Setting this attribute to true will remove existing ISE Intermediate CSR
}
type RequestCertificatesRenewCertificates struct {
CertType string `json:"certType,omitempty"` //
}
type RequestCertificatesBindCsr struct {
Admin *bool `json:"admin,omitempty"` // Use certificate to authenticate the ISE Admin Portal
AllowExtendedValidity *bool `json:"allowExtendedValidity,omitempty"` // Allow import of certificates with validity greater than 398 days
AllowOutOfDateCert *bool `json:"allowOutOfDateCert,omitempty"` // Allow out of date certificates (required)
AllowReplacementOfCertificates *bool `json:"allowReplacementOfCertificates,omitempty"` // Allow Replacement of certificates (required)
AllowReplacementOfPortalGroupTag *bool `json:"allowReplacementOfPortalGroupTag,omitempty"` // Allow Replacement of Portal Group Tag (required)
Data string `json:"data,omitempty"` // Signed Certificate in escaped format
Eap *bool `json:"eap,omitempty"` // Use certificate for EAP protocols that use SSL/TLS tunneling
HostName string `json:"hostName,omitempty"` // Name of Host whose CSR ID has been provided
ID string `json:"id,omitempty"` // ID of the generated CSR
Ims *bool `json:"ims,omitempty"` // Use certificate for the ISE Messaging Service
Name string `json:"name,omitempty"` // Friendly Name of the certificate
Portal *bool `json:"portal,omitempty"` // Use for portal
PortalGroupTag string `json:"portalGroupTag,omitempty"` // Set Group tag
Pxgrid *bool `json:"pxgrid,omitempty"` // Use certificate for the pxGrid Controller
Radius *bool `json:"radius,omitempty"` // Use certificate for the RADSec server
Saml *bool `json:"saml,omitempty"` // Use certificate for SAML Signing
ValidateCertificateExtensions *bool `json:"validateCertificateExtensions,omitempty"` // Validate Certificate Extensions
}
type RequestCertificatesExportSystemCertificate struct {
Export string `json:"export,omitempty"` //
ID string `json:"id,omitempty"` //
Password string `json:"password,omitempty"` //
}
type RequestCertificatesImportSystemCertificate struct {
Admin *bool `json:"admin,omitempty"` // Use certificate to authenticate the ISE Admin Portal
AllowExtendedValidity *bool `json:"allowExtendedValidity,omitempty"` // Allow import of certificates with validity greater than 398 days
AllowOutOfDateCert *bool `json:"allowOutOfDateCert,omitempty"` // Allow out of date certificates (required)
AllowReplacementOfCertificates *bool `json:"allowReplacementOfCertificates,omitempty"` // Allow Replacement of certificates (required)
AllowReplacementOfPortalGroupTag *bool `json:"allowReplacementOfPortalGroupTag,omitempty"` // Allow Replacement of Portal Group Tag (required)
AllowSHA1Certificates *bool `json:"allowSHA1Certificates,omitempty"` // Allow SHA1 based certificates (required)
AllowWildCardCertificates *bool `json:"allowWildCardCertificates,omitempty"` // Allow Wildcard Certificates
Data string `json:"data,omitempty"` // Certificate Content (required)
Eap *bool `json:"eap,omitempty"` // Use certificate for EAP protocols that use SSL/TLS tunneling
Ims *bool `json:"ims,omitempty"` // Use certificate for the ISE Messaging Service
Name string `json:"name,omitempty"` // Name of the certificate
Password string `json:"password,omitempty"` // Certificate Password (required).
Portal *bool `json:"portal,omitempty"` // Use for portal
PortalGroupTag string `json:"portalGroupTag,omitempty"` // Set Group tag
PrivateKeyData string `json:"privateKeyData,omitempty"` // Private Key data (required)
Pxgrid *bool `json:"pxgrid,omitempty"` // Use certificate for the pxGrid Controller
Radius *bool `json:"radius,omitempty"` // Use certificate for the RADSec server
Saml *bool `json:"saml,omitempty"` // Use certificate for SAML Signing
ValidateCertificateExtensions *bool `json:"validateCertificateExtensions,omitempty"` // Validate Certificate Extensions
}
type RequestCertificatesUpdateSystemCertificate struct {
Admin *bool `json:"admin,omitempty"` // Use certificate to authenticate the ISE Admin Portal
AllowReplacementOfPortalGroupTag *bool `json:"allowReplacementOfPortalGroupTag,omitempty"` // Allow Replacement of Portal Group Tag (required)
Description string `json:"description,omitempty"` // Description of System Certificate
Eap *bool `json:"eap,omitempty"` // Use certificate for EAP protocols that use SSL/TLS tunneling
ExpirationTTLPeriod *int `json:"expirationTTLPeriod,omitempty"` //
ExpirationTTLUnits string `json:"expirationTTLUnits,omitempty"` //
Ims *bool `json:"ims,omitempty"` // Use certificate for the ISE Messaging Service
Name string `json:"name,omitempty"` // Name of the certificate
Portal *bool `json:"portal,omitempty"` // Use for portal
PortalGroupTag string `json:"portalGroupTag,omitempty"` // Set Group tag
Pxgrid *bool `json:"pxgrid,omitempty"` // Use certificate for the pxGrid Controller
Radius *bool `json:"radius,omitempty"` // Use certificate for the RADSec server
RenewSelfSignedCertificate *bool `json:"renewSelfSignedCertificate,omitempty"` // Renew Self Signed Certificate
Saml *bool `json:"saml,omitempty"` // Use certificate for SAML Signing
}
type RequestCertificatesImportTrustCertificate struct {
AllowBasicConstraintCaFalse *bool `json:"allowBasicConstraintCAFalse,omitempty"` // Allow Certificates with Basic Constraints CA Field as False (required)
AllowOutOfDateCert *bool `json:"allowOutOfDateCert,omitempty"` // Allow out of date certificates (required)
AllowSHA1Certificates *bool `json:"allowSHA1Certificates,omitempty"` // Allow SHA1 based certificates (required)
Data string `json:"data,omitempty"` // Certificate content (required)
Description string `json:"description,omitempty"` // Description of the certificate
Name string `json:"name,omitempty"` // Name of the certificate
ValidateCertificateExtensions *bool `json:"validateCertificateExtensions,omitempty"` // Validate trust certificate extension
TrustForCertificateBasedAdminAuth *bool `json:"trustForCertificateBasedAdminAuth,omitempty"` // Trust for Certificate based Admin authentication
TrustForCiscoServicesAuth *bool `json:"trustForCiscoServicesAuth,omitempty"` // Trust for authentication of Cisco Services
TrustForClientAuth *bool `json:"trustForClientAuth,omitempty"` // Trust for client authentication and Syslog
TrustForIseAuth *bool `json:"trustForIseAuth,omitempty"` // Trust for authentication within ISE
}
type RequestCertificatesUpdateTrustedCertificate struct {
AuthenticateBeforeCRLReceived *bool `json:"authenticateBeforeCRLReceived,omitempty"` // Switch to enable/disable CRL Verification if CRL is not Received
AutomaticCRLUpdate *bool `json:"automaticCRLUpdate,omitempty"` // Switch to enable/disable automatic CRL update
AutomaticCRLUpdatePeriod *int `json:"automaticCRLUpdatePeriod,omitempty"` // Automatic CRL update period
AutomaticCRLUpdateUnits string `json:"automaticCRLUpdateUnits,omitempty"` // Unit of time for automatic CRL update
CrlDistributionURL string `json:"crlDistributionUrl,omitempty"` // CRL Distribution URL
CrlDownloadFailureRetries *int `json:"crlDownloadFailureRetries,omitempty"` // If CRL download fails, wait time before retry
CrlDownloadFailureRetriesUnits string `json:"crlDownloadFailureRetriesUnits,omitempty"` // Unit of time before retry if CRL download fails
Description string `json:"description,omitempty"` // Description for trust certificate
DownloadCRL *bool `json:"downloadCRL,omitempty"` // Switch to enable/disable download of CRL
EnableOCSpValidation *bool `json:"enableOCSPValidation,omitempty"` // Switch to enable/disable OCSP Validation
EnableServerIDentityCheck *bool `json:"enableServerIdentityCheck,omitempty"` // Switch to enable/disable verification if HTTPS or LDAP server certificate name fits the configured server URL
IgnoreCRLExpiration *bool `json:"ignoreCRLExpiration,omitempty"` // Switch to enable/disable ignore CRL Expiration
Name string `json:"name,omitempty"` // Friendly name of the certificate
NonAutomaticCRLUpdatePeriod *int `json:"nonAutomaticCRLUpdatePeriod,omitempty"` // Non automatic CRL update period
NonAutomaticCRLUpdateUnits string `json:"nonAutomaticCRLUpdateUnits,omitempty"` // Unit of time of non automatic CRL update
RejectIfNoStatusFromOCSP *bool `json:"rejectIfNoStatusFromOCSP,omitempty"` // Switch to reject certificate if there is no status from OCSP
RejectIfUnreachableFromOCSP *bool `json:"rejectIfUnreachableFromOCSP,omitempty"` // Switch to reject certificate if unreachable from OCSP
SelectedOCSpService string `json:"selectedOCSPService,omitempty"` // Name of selected OCSP Service
Status string `json:"status,omitempty"` //
TrustForCertificateBasedAdminAuth *bool `json:"trustForCertificateBasedAdminAuth,omitempty"` // Trust for Certificate based Admin authentication
TrustForCiscoServicesAuth *bool `json:"trustForCiscoServicesAuth,omitempty"` // Trust for authentication of Cisco Services
TrustForClientAuth *bool `json:"trustForClientAuth,omitempty"` // Trust for client authentication and Syslog
TrustForIseAuth *bool `json:"trustForIseAuth,omitempty"` // Trust for authentication within ISE
}
//GetCsrs Purpose of the API is to get all Certificate Signing Requests from PAN.
/* This API supports Filtering, Sorting and Pagination.
Filtering and Sorting supported on below mentioned attributes:
friendlyName
subject
timeStamp
Supported Date Format: yyyy-MM-dd HH:mm:ss.SSS
Supported Operators: EQ, NEQ, GT and LT
@param getCSRsQueryParams Filtering parameter
*/
func (s *CertificatesService) GetCsrs(getCSRsQueryParams *GetCsrsQueryParams) (*ResponseCertificatesGetCsrs, *resty.Response, error) {
setHost(s.client, "_ui")
path := "/api/v1/certs/certificate-signing-request"
queryString, _ := query.Values(getCSRsQueryParams)
setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetQueryString(queryString.Encode()).SetResult(&ResponseCertificatesGetCsrs{}).
SetError(&Error).
Get(path)
if err != nil {
return nil, nil, err
}
if response.IsError() {
return nil, response, fmt.Errorf("error with operation GetCsrs")
}
getCSFRToken(response.Header())
result := response.Result().(*ResponseCertificatesGetCsrs)
return result, response, err
}
//ExportCsr Purpose of the API is to export a CSR, given a CSR id and a hostname.
/* The response of this API carries a CSR corresponding to the requested ID
@param hostname hostname path parameter. The hostname to which the CSR belongs.
@param id id path parameter. The ID of the CSR to be exported.
*/
func (s *CertificatesService) ExportCsr(hostname string, id string) (FileDownload, *resty.Response, error) {
setHost(s.client, "_ui")
path := "/api/v1/certs/certificate-signing-request/export/{hostname}/{id}"
path = strings.Replace(path, "{hostname}", fmt.Sprintf("%v", hostname), -1)
path = strings.Replace(path, "{id}", fmt.Sprintf("%v", id), -1)
setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetError(&Error).
Get(path)
fdownload := FileDownload{}
if err != nil {
return fdownload, nil, err
}
if response.IsError() {
return fdownload, response, fmt.Errorf("error with operation ExportTrustedCertificate")
}
fdownload.FileData = response.Body()
headerVal := response.Header()["Content-Disposition"][0]
fname := strings.SplitAfter(headerVal, "=")
fdownload.FileName = strings.ReplaceAll(fname[1], "\"", "")
getCSFRToken(response.Header())
return fdownload, response, err
}
//GetCsrByID Purpose of the API is to get Certificate Signing Request(CSR) by ID
/* This API displays details of a Certificate Signing Request of a particular node based on a given HostName and ID.
@param hostName hostName path parameter. Name of the host of which CSR's should be returned
@param id id path parameter. The ID of the Certificate Signing Request returned
*/
func (s *CertificatesService) GetCsrByID(hostName string, id string) (*ResponseCertificatesGetCsrByID, *resty.Response, error) {
setHost(s.client, "_ui")
path := "/api/v1/certs/certificate-signing-request/{hostName}/{id}"
path = strings.Replace(path, "{hostName}", fmt.Sprintf("%v", hostName), -1)
path = strings.Replace(path, "{id}", fmt.Sprintf("%v", id), -1)
setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetResult(&ResponseCertificatesGetCsrByID{}).
SetError(&Error).
Get(path)
if err != nil {
return nil, nil, err
}
if response.IsError() {
return nil, response, fmt.Errorf("error with operation GetCsrById")
}
getCSFRToken(response.Header())
result := response.Result().(*ResponseCertificatesGetCsrByID)
return result, response, err
}
//GetSystemCertificates Purpose of this API is to get all system certificates of a particular node
/* This API supports Filtering, Sorting and Pagination.
Filtering and Sorting supported on below mentioned attributes:
friendlyName
issuedTo
issuedBy
validFrom
Supported Date Format: yyyy-MM-dd HH:mm:ss
Supported Operators: EQ, NEQ, GT and LT
expirationDate
Supported Date Format: yyyy-MM-dd HH:mm:ss
Supported Operators: EQ, NEQ, GT and LT
@param hostName hostName path parameter. Name of the host of which system certificates should be returned
@param getSystemCertificatesQueryParams Filtering parameter
*/
func (s *CertificatesService) GetSystemCertificates(hostName string, getSystemCertificatesQueryParams *GetSystemCertificatesQueryParams) (*ResponseCertificatesGetSystemCertificates, *resty.Response, error) {
setHost(s.client, "_ui")
path := "/api/v1/certs/system-certificate/{hostName}"
path = strings.Replace(path, "{hostName}", fmt.Sprintf("%v", hostName), -1)
queryString, _ := query.Values(getSystemCertificatesQueryParams)
setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetQueryString(queryString.Encode()).SetResult(&ResponseCertificatesGetSystemCertificates{}).
SetError(&Error).
Get(path)
if err != nil {
return nil, nil, err
}
if response.IsError() {
return nil, response, fmt.Errorf("error with operation GetSystemCertificates")
}
getCSFRToken(response.Header())
result := response.Result().(*ResponseCertificatesGetSystemCertificates)
return result, response, err
}
//GetSystemCertificateByID Purpose of this API is to get system certificate of a particular node by Id
/* This API displays details of a System Certificate of a particular node based on a given HostName and ID.
@param hostName hostName path parameter. Name of the host of which system certificates should be returned
@param id id path parameter. The id of the system certificate
*/
func (s *CertificatesService) GetSystemCertificateByID(hostName string, id string) (*ResponseCertificatesGetSystemCertificateByID, *resty.Response, error) {
setHost(s.client, "_ui")
path := "/api/v1/certs/system-certificate/{hostName}/{id}"
path = strings.Replace(path, "{hostName}", fmt.Sprintf("%v", hostName), -1)
path = strings.Replace(path, "{id}", fmt.Sprintf("%v", id), -1)
setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetResult(&ResponseCertificatesGetSystemCertificateByID{}).
SetError(&Error).
Get(path)
if err != nil {
return nil, nil, err
}
if response.IsError() {
return nil, response, fmt.Errorf("error with operation GetSystemCertificateById")
}
getCSFRToken(response.Header())
result := response.Result().(*ResponseCertificatesGetSystemCertificateByID)
return result, response, err
}
//GetTrustedCertificates Purpose of this API is to get list of all trusted certificates
/* This API supports Filtering, Sorting and Pagination.
Filtering and Sorting supported on below mentioned attributes:
friendlyName
subject
issuedTo
issuedBy
validFrom
Supported Date Format: yyyy-MM-dd HH:mm:ss
Supported Operators: EQ, NEQ, GT and LT
expirationDate
Supported Date Format: yyyy-MM-dd HH:mm:ss
Supported Operators: EQ, NEQ, GT and LT
status
Allowed values: enabled, disabled
Supported Operators: EQ, NEQ
@param getTrustedCertificatesQueryParams Filtering parameter
*/
func (s *CertificatesService) GetTrustedCertificates(getTrustedCertificatesQueryParams *GetTrustedCertificatesQueryParams) (*ResponseCertificatesGetTrustedCertificates, *resty.Response, error) {
setHost(s.client, "_ui")
path := "/api/v1/certs/trusted-certificate"
queryString, _ := query.Values(getTrustedCertificatesQueryParams)
setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetQueryString(queryString.Encode()).SetResult(&ResponseCertificatesGetTrustedCertificates{}).
SetError(&Error).
Get(path)
if err != nil {
return nil, nil, err
}
if response.IsError() {
return nil, response, fmt.Errorf("error with operation GetTrustedCertificates")
}
getCSFRToken(response.Header())
result := response.Result().(*ResponseCertificatesGetTrustedCertificates)
return result, response, err
}
//ExportTrustedCertificate Purpose of the API is to export a trust certificate given a certificate id.
/* The response of this API carries a trusted certificate file mapped to the requested id
@param id id path parameter. The ID of the Trusted Certificate to be exported.
*/
func (s *CertificatesService) ExportTrustedCertificate(id string) (FileDownload, *resty.Response, error) {
setHost(s.client, "_ui")
path := "/api/v1/certs/trusted-certificate/export/{id}"
path = strings.Replace(path, "{id}", fmt.Sprintf("%v", id), -1)
setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetError(&Error).
Get(path)
fdownload := FileDownload{}
if err != nil {
return fdownload, nil, err
}
if response.IsError() {
return fdownload, response, fmt.Errorf("error with operation ExportTrustedCertificate")
}
fdownload.FileData = response.Body()
headerVal := response.Header()["Content-Disposition"][0]
fname := strings.SplitAfter(headerVal, "=")
fdownload.FileName = strings.ReplaceAll(fname[1], "\"", "")
getCSFRToken(response.Header())
return fdownload, response, err
}
//GetTrustedCertificateByID Purpose of this API is to get Trust Certificate By Id
/* This API can displays details of a Trust Certificate based on a given ID.
@param id id path parameter. The id of the trust certificate
*/
func (s *CertificatesService) GetTrustedCertificateByID(id string) (*ResponseCertificatesGetTrustedCertificateByID, *resty.Response, error) {
setHost(s.client, "_ui")
path := "/api/v1/certs/trusted-certificate/{id}"
path = strings.Replace(path, "{id}", fmt.Sprintf("%v", id), -1)
setCSRFToken(s.client)
response, err := s.client.R().
SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetResult(&ResponseCertificatesGetTrustedCertificateByID{}).
SetError(&Error).
Get(path)
if err != nil {
return nil, nil, err
}
if response.IsError() {
return nil, response, fmt.Errorf("error with operation GetTrustedCertificateById")
}
getCSFRToken(response.Header())
result := response.Result().(*ResponseCertificatesGetTrustedCertificateByID)
return result, response, err
}
//GenerateCsr Purpose of this API is to generate a Certificate Signing Request (CSR).
/*
Generate a certificate signing request for Multi-Use, Admin, EAP Authentication, RADIUS DTLS, PxGrid, SAML, Portal and IMS Services.