Skip to content

Commit 3fe1b2e

Browse files
authored
Merge pull request #11 from Keyfactor/dev-1.0
Dev 1.0
2 parents 0e22cbb + 803b985 commit 3fe1b2e

4 files changed

Lines changed: 11 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ Inital Release. Support for Enroll, Sync, and Revocation.
44
1.0.1
55
Bugfix - sync records with null serial
66
Bugfix - Fix for custom fields in enrollment
7+
8+
1.0.2
9+
Handle change to Sectigo API Revocation call

integration-manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"update_catalog": true,
99
"description": "Sectigo Certificate Manager plugin for the AnyCA REST Gateway framework",
1010
"gateway_framework": "24.2.0",
11-
"release_dir": "sectigo-scm-caplugin/bin/Release/net6.0",
11+
"release_dir": "sectigo-scm-caplugin/bin/Release",
12+
"release_project": "sectigo-scm-caplugin/sectigo-scm-caplugin.csproj",
1213
"about": {
1314
"carest": {
1415
"ca_plugin_config": [

sectigo-scm-caplugin/Client/SectigoClient.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,11 @@ public async Task<List<Certificate>> PageCertificates(int position = 0, int size
140140
return await ProcessResponse<List<Certificate>>(response);
141141
}
142142

143-
public async Task<bool> RevokeSslCertificateById(int sslId, string revreason)
143+
public async Task<bool> RevokeSslCertificateById(int sslId, int revcode, string revreason)
144144
{
145145
JObject o = JObject.FromObject(new
146146
{
147+
reasonCode = revcode,
147148
reason = revreason
148149
});
149150
var response = await RestClient.PostAsJsonAsync($"api/ssl/v1/revoke/{sslId}", o);

sectigo-scm-caplugin/SectigoCAPlugin.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ public async Task<int> Revoke(string caRequestID, string hexSerialNumber, uint r
463463
try
464464
{
465465
var client = SectigoClient.InitializeClient(_config);
466-
var response = Task.Run(async () => await client.RevokeSslCertificateById(int.Parse(caRequestID), RevokeReasonToString(revocationReason))).Result;
466+
var response = Task.Run(async () => await client.RevokeSslCertificateById(int.Parse(caRequestID), (int)revocationReason, RevokeReasonToString(revocationReason))).Result;
467467

468468
_logger.MethodExit(LogLevel.Debug);
469469
if (response)//will throw an exception if false
@@ -875,26 +875,18 @@ public static string RevokeReasonToString(UInt32 revokeType)
875875
{
876876
switch (revokeType)
877877
{
878+
case 0:
879+
return "Unspecified";
878880
case 1:
879881
return "Compromised Key";
880-
881-
case 2:
882-
return "CA Compromised";
883-
884882
case 3:
885883
return "Affiliation Changed";
886-
887884
case 4:
888885
return "Superseded";
889-
890886
case 5:
891887
return "Cessation of Operation";
892-
893-
case 6:
894-
return "Certificate Hold";
895-
896888
default:
897-
return "Unspecified";
889+
throw new Exception($"Invalid revocation code: {revokeType.ToString()}. Valid values are 0,1,3-5");
898890
}
899891
}
900892
}

0 commit comments

Comments
 (0)