Skip to content

Commit f8ca24c

Browse files
authored
Merge branch 'main' into release-1.0
2 parents 94c8bda + 65cff10 commit f8ca24c

4 files changed

Lines changed: 57 additions & 23 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ This integration is tested and confirmed as working for Anygateway REST 24.4 and
120120
The CAPlugin currently supports **one** authentication method: **AWS Access Key ID + Secret Access Key**.
121121
**OAuth** and **Default SDK authentication** will be enabled in later updates. There is functionality present via the **Keyfactor AWS Authentication** library, but these alternate methods are currently ***untested***.
122122
123+
### Known Issues
124+
125+
At present, a fresh install of Keyfactor Command 24.4 used in conjuction with Keyfactor Gateway REST 25.4.0.0 is confirmed as working. A fresh install of Command 25.3 used with REST 25.4.0.0 is also confirmed as working.
126+
Latest version of Command 25.4 may run into issues, investigation into compatibility issues is ongoing.
127+
123128
### What you need ready
124129
125130
Before configuring the CAPlugin, have the following prepared:

aws-pca-caplugin/AWSPCACAPlugin.cs

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -440,35 +440,59 @@ public async Task<EnrollmentResult> Enroll(
440440
string priorRequestId;
441441
try
442442
{
443-
priorRequestId = await _certificateDataReader
444-
.GetRequestIDBySerialNumber(priorSn)
443+
return await IssueAndFetchAsync(
444+
csr,
445+
productInfo.ProductID,
446+
days,
447+
signingAlgorithm,
448+
"Certificate Issued")
445449
.ConfigureAwait(false);
446450
}
447-
catch (Exception ex)
451+
452+
case EnrollmentType.RenewOrReissue:
448453
{
449-
return new EnrollmentResult
454+
if (productInfo.ProductParameters == null ||
455+
!TryGetProductParam(productInfo.ProductParameters, "PriorCertSN", out var priorSn) ||
456+
string.IsNullOrWhiteSpace(priorSn))
457+
return new EnrollmentResult
458+
{
459+
Status = (int)EndEntityStatus.FAILED,
460+
StatusMessage =
461+
"Renew/Reissue requires ProductParameters['PriorCertSN'] (hex serial number)."
462+
};
463+
464+
string priorRequestId;
465+
try
450466
{
451-
Status = (int)EndEntityStatus.FAILED,
452-
StatusMessage = $"Could not resolve PriorCertSN to request id: {ex.Message}"
453-
};
454-
}
467+
priorRequestId = await _certificateDataReader
468+
.GetRequestIDBySerialNumber(priorSn)
469+
.ConfigureAwait(false);
470+
}
471+
catch (Exception ex)
472+
{
473+
return new EnrollmentResult
474+
{
475+
Status = (int)EndEntityStatus.FAILED,
476+
StatusMessage = $"Could not resolve PriorCertSN to request id: {ex.Message}"
477+
};
478+
}
455479

456-
var expiration = _certificateDataReader.GetExpirationDateByRequestId(priorRequestId);
457-
var isRenewal = expiration.HasValue && expiration.Value.ToUniversalTime() <= DateTime.UtcNow;
480+
var expiration = _certificateDataReader.GetExpirationDateByRequestId(priorRequestId);
481+
var isRenewal = expiration.HasValue && expiration.Value.ToUniversalTime() <= DateTime.UtcNow;
458482

459-
var msg = isRenewal ? "Certificate Renewed" : "Certificate Reissued";
460-
var token = BuildIdempotencyToken(isRenewal ? "renew" : "reissue", priorRequestId, csr);
483+
var msg = isRenewal ? "Certificate Renewed" : "Certificate Reissued";
484+
var token = BuildIdempotencyToken(isRenewal ? "renew" : "reissue", priorRequestId, csr);
461485

462-
// Still "IssueCertificate" under the hood; PCA doesn't have first-class renew/reissue.
463-
return await IssueAndFetchAsync(
464-
csr,
465-
productInfo.ProductID,
466-
days,
467-
msg,
468-
// Optional: stable-ish idempotency (helps avoid duplicates if caller retries quickly)
469-
token)
470-
.ConfigureAwait(false);
471-
}
486+
// Still "IssueCertificate" under the hood; PCA doesn't have first-class renew/reissue.
487+
return await IssueAndFetchAsync(
488+
csr,
489+
productInfo.ProductID,
490+
days,
491+
msg,
492+
// Optional: stable-ish idempotency (helps avoid duplicates if caller retries quickly)
493+
token)
494+
.ConfigureAwait(false);
495+
}
472496

473497
default:
474498
return new EnrollmentResult

aws-pca-caplugin/Client/ACMPCAClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,4 +781,4 @@ private static class ConfigKeys
781781
public const string Region = "Region";
782782
public const string S3Bucket = "S3Bucket";
783783
}
784-
}
784+
}

docsource/configuration.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ Download the **PCA root certificate** from AWS and have it ready to import into
1313
The CAPlugin currently supports **one** authentication method: **AWS Access Key ID + Secret Access Key**.
1414
**OAuth** and **Default SDK authentication** will be enabled in later updates. There is functionality present via the **Keyfactor AWS Authentication** library, but these alternate methods are currently ***untested***.
1515

16+
### Known Issues
17+
18+
At present, a fresh install of Keyfactor Command 24.4 used in conjuction with Keyfactor Gateway REST 25.4.0.0 is confirmed as working. A fresh install of Command 25.3 used with REST 25.4.0.0 is also confirmed as working.
19+
Latest version of Command 25.4 may run into issues, investigation into compatibility issues is ongoing.
20+
1621
### What you need ready
1722

1823
Before configuring the CAPlugin, have the following prepared:

0 commit comments

Comments
 (0)