From d15630ece11f1e7e5440ea2ce01affdf5b49a745 Mon Sep 17 00:00:00 2001 From: Keyfactor Date: Tue, 25 Oct 2022 17:15:40 +0000 Subject: [PATCH 01/19] Update generated README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 82d80ba..099d433 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,9 @@ HydrantId operates a PKI as a service platform for customers around the globe. This repository contains an AnyGateway CA Connector, which is a plugin to the Keyfactor AnyGateway. AnyGateway CA Connectors allow Keyfactor Command to be used for inventory, issuance, and revocation of certificates from a third-party certificate authority. ---- + + + *** # Getting Started From 769f79f939d3b5c81d3437191971b939400ca489 Mon Sep 17 00:00:00 2001 From: Brian Hill <76450501+bhillkeyfactor@users.noreply.github.com> Date: Tue, 25 Oct 2022 19:40:45 +0000 Subject: [PATCH 02/19] Metarel (#3) * Meta Data Support Additions * Update generated README --- .../HydrantIdProxy/Client/HydrantIdClient.cs | 24 ++++++++++ .../src/HydrantIdProxy/HydrantIdProxy.cs | 45 ++++++++++++++++--- .../src/HydrantIdProxy/RequestManager.cs | 12 ++--- 3 files changed, 68 insertions(+), 13 deletions(-) diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/HydrantIdClient.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/HydrantIdClient.cs index bd8959a..085e2c8 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/HydrantIdClient.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/HydrantIdClient.cs @@ -194,6 +194,30 @@ public async Task GetSubmitGetCertificateAsync(string certificateId } } + public async Task GetSubmitGetCertificateByCsrAsync(string requestTrackingId) + { + try + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + var apiEndpoint = $"/api/v2/csr/{requestTrackingId}/certificate"; + Logger.Trace($"API Url {BaseUrl + apiEndpoint}"); + var restClient = ConfigureRestClient("get", BaseUrl + apiEndpoint); + + using (var resp = await restClient.GetAsync(apiEndpoint)) + { + resp.EnsureSuccessStatusCode(); + var getCertificateResponse = + JsonConvert.DeserializeObject(await resp.Content.ReadAsStringAsync()); + return getCertificateResponse; + } + } + catch (Exception e) + { + Logger.Error($"Error Occured in HydrantIdClient.GetSubmitGetCertificateAsync: {e.Message}"); + throw; + } + } + public async Task GetSubmitRevokeCertificateAsync(string hydrantId, RevocationReasons revokeReason) { diff --git a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs index 201f713..848c608 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Security.Cryptography.X509Certificates; using System.Text; @@ -117,11 +118,11 @@ public override void Synchronize(ICertificateDataReader certificateDataReader, try { var currentCert = new X509Certificate2(Encoding.ASCII.GetBytes(cert)); + var caReqId = $"{currentResponseItem.Id}-{currentCert.SerialNumber}"; Logger.Trace($"Split Cert Value: {cert}"); blockingBuffer.Add(new CAConnectorCertificate { - CARequestID = - $"{currentResponseItem.Id}-{currentCert.SerialNumber}", + CARequestID =$"{currentResponseItem.Id}", Certificate = cert, SubmissionDate = Convert.ToDateTime(singleCert.Result.CreatedAt), Status = certStatus, @@ -170,6 +171,8 @@ public override EnrollmentResult Enroll(ICertificateDataReader certificateDataRe Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); CertRequestResult enrollmentResponse = null; + Certificate csrTrackingResponse=null; + switch (enrollmentType) { case RequestUtilities.EnrollmentType.New: @@ -194,6 +197,8 @@ public override EnrollmentResult Enroll(ICertificateDataReader certificateDataRe .Result; Logger.Trace($"Enrollment Response JSON: {JsonConvert.SerializeObject(enrollmentResponse)}"); + csrTrackingResponse = GetCertificateOnTimer(enrollmentResponse.RequestStatus.Id); + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); break; @@ -221,18 +226,44 @@ await HydrantIdClient.GetSubmitRenewalAsync(certificateId, renewalRequest)) Logger.Trace($"Renew Response JSON: {JsonConvert.SerializeObject(enrollmentResponse)}"); + csrTrackingResponse = GetCertificateOnTimer(enrollmentResponse.RequestStatus.Id); + break; } - return _requestManager.GetEnrollmentResult(enrollmentResponse); + return _requestManager.GetEnrollmentResult(csrTrackingResponse); } + private Certificate GetCertificateOnTimer(string Id) + { + //Get the csr tracking response from the tracking Id returned from Enrollment + var stopwatch = new Stopwatch(); + stopwatch.Start(); + + Certificate csrTrackingResponse = null; + + while (stopwatch.Elapsed < TimeSpan.FromSeconds(60) && csrTrackingResponse == null) + { + try + { + csrTrackingResponse = + Task.Run(async () => await HydrantIdClient.GetSubmitGetCertificateByCsrAsync(Id)) + .Result; + } + catch (System.AggregateException e) + { + Logger.Trace($"Enrollment Response Not Available Yet, try again {LogHandler.FlattenException(e)}."); + } + Thread.Sleep(1000); + } + + return csrTrackingResponse; + } public override CAConnectorCertificate GetSingleRecord(string caRequestId) { Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - var keyfactorCaId = caRequestId.Substring(0, 36); //todo fix to use pipe delimiter - Logger.Trace($"Keyfactor Ca Id: {keyfactorCaId}"); + Logger.Trace($"Keyfactor Ca Id: {caRequestId}"); try { var certificateResponse = @@ -244,7 +275,7 @@ await HydrantIdClient.GetSubmitGetCertificateAsync(caRequestId.Substring(0, 36)) Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); return new CAConnectorCertificate { - CARequestID = keyfactorCaId, + CARequestID = caRequestId, Certificate = certificateResponse.Pem, ResolutionDate = Convert.ToDateTime(certificateResponse.NotAfter), Status = _requestManager.GetMapReturnStatus(certificateResponse.RevocationStatus), @@ -255,7 +286,7 @@ await HydrantIdClient.GetSubmitGetCertificateAsync(caRequestId.Substring(0, 36)) { return new CAConnectorCertificate { - CARequestID = keyfactorCaId, + CARequestID = caRequestId, Status = _requestManager.GetMapReturnStatus(0) //Unknown }; } diff --git a/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs b/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs index 7443af5..aadecc7 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs @@ -224,28 +224,28 @@ public CertRequestBodySubjectAltNames GetSansRequest(Dictionary0) + if (!enrollmentResult.Id.HasValue) { return new EnrollmentResult { Status = 30, //failure - StatusMessage = $"Enrollment Failed with the following error: {enrollmentResult.ErrorReturn.Error}" + StatusMessage = $"Enrollment Failed with could not get the certificate from the request tracking id" }; } - if (enrollmentResult.RequestStatus != null && enrollmentResult.RequestStatus.IssuanceStatus.Equals(IssuanceStatus.Pending)) + if (enrollmentResult.Id.HasValue) { return new EnrollmentResult { Status = 13, //success - CARequestID = enrollmentResult.RequestStatus.Id, + CARequestID = enrollmentResult.Id.ToString(), StatusMessage = - $"Order Successfully Created With Order Number {enrollmentResult.RequestStatus.Id}" + $"Order Successfully Created With Order Number {enrollmentResult.Id.ToString()}" }; } From dc5df0393a98c395988627a5a2406aad25d1c9f9 Mon Sep 17 00:00:00 2001 From: Brian Hill <76450501+bhillkeyfactor@users.noreply.github.com> Date: Tue, 25 Oct 2022 15:57:48 -0400 Subject: [PATCH 03/19] Create CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..dc1f4a2 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +v1.1.0 +- Added Support for Meta Data In Keyfactor +- Put enroll on a timer to wait for request so Meta Data Could be Pulled down + +v1.0.3: +- Original Release Version From b67937d4765b592d3b2a007460882d9dc622244e Mon Sep 17 00:00:00 2001 From: Brian Hill <76450501+bhillkeyfactor@users.noreply.github.com> Date: Mon, 31 Oct 2022 18:15:10 +0000 Subject: [PATCH 04/19] Errorfixes (#6) * fixed error handling from Hydrant API changes * Fixed Enrollment External Validation --- CHANGELOG.md | 3 + .../HydrantIdProxy/Client/HydrantIdClient.cs | 4 +- .../Client/Models/ErrorReturn.cs | 4 +- .../src/HydrantIdProxy/HydrantIdProxy.cs | 99 ++++++++++++------- .../HydrantIdProxy/Interfaces/IErrorReturn.cs | 2 +- .../src/HydrantIdProxy/RequestManager.cs | 25 +++-- 6 files changed, 86 insertions(+), 51 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc1f4a2..6f3a28e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +v1.1.1 +- Fixed error handing to match Hydrant new API Structure + v1.1.0 - Added Support for Meta Data In Keyfactor - Put enroll on a timer to wait for request so Meta Data Could be Pulled down diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/HydrantIdClient.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/HydrantIdClient.cs index 085e2c8..3fa72bb 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/HydrantIdClient.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/HydrantIdClient.cs @@ -192,8 +192,8 @@ public async Task GetSubmitGetCertificateAsync(string certificateId Logger.Error($"Error Occured in HydrantIdClient.GetSubmitGetCertificateAsync: {e.Message}"); throw; } - } - + } + public async Task GetSubmitGetCertificateByCsrAsync(string requestTrackingId) { try diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/ErrorReturn.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/ErrorReturn.cs index 814e189..0a3ecf9 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/ErrorReturn.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/ErrorReturn.cs @@ -5,7 +5,7 @@ namespace Keyfactor.HydrantId.Client.Models { public class ErrorReturn : IErrorReturn { - [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] public int Status { get; set; } - [JsonProperty("error", NullValueHandling = NullValueHandling.Ignore)] public string Error { get; set; } + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] public string Status { get; set; } + [JsonProperty("message", NullValueHandling = NullValueHandling.Ignore)] public string Error { get; set; } } } diff --git a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs index 848c608..5c4cc18 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; -using System.Diagnostics; +using System.Diagnostics; using System.Linq; using System.Security.Cryptography.X509Certificates; using System.Text; @@ -117,7 +117,7 @@ public override void Synchronize(ICertificateDataReader certificateDataReader, foreach (var cert in splitCerts) try { - var currentCert = new X509Certificate2(Encoding.ASCII.GetBytes(cert)); + var currentCert = new X509Certificate2(Encoding.ASCII.GetBytes(cert)); var caReqId = $"{currentResponseItem.Id}-{currentCert.SerialNumber}"; Logger.Trace($"Split Cert Value: {cert}"); blockingBuffer.Add(new CAConnectorCertificate @@ -195,10 +195,22 @@ public override EnrollmentResult Enroll(ICertificateDataReader certificateDataRe enrollmentResponse = Task.Run(async () => await HydrantIdClient.GetSubmitEnrollmentAsync(enrollmentRequest)) .Result; - Logger.Trace($"Enrollment Response JSON: {JsonConvert.SerializeObject(enrollmentResponse)}"); - - csrTrackingResponse = GetCertificateOnTimer(enrollmentResponse.RequestStatus.Id); - + Logger.Trace($"Enrollment Response JSON: {JsonConvert.SerializeObject(enrollmentResponse)}"); + + if (enrollmentResponse?.ErrorReturn?.Status != "Failure") + { + csrTrackingResponse = GetCertificateOnTimer(enrollmentResponse?.RequestStatus?.Id); + } + else + { + return new EnrollmentResult + { + Status = 30, //failure + StatusMessage = $"Enrollment Failed with error {enrollmentResponse?.ErrorReturn?.Error}" + }; + } + + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); break; @@ -223,41 +235,52 @@ public override EnrollmentResult Enroll(ICertificateDataReader certificateDataRe Task.Run(async () => await HydrantIdClient.GetSubmitRenewalAsync(certificateId, renewalRequest)) .Result; - Logger.Trace($"Renew Response JSON: {JsonConvert.SerializeObject(enrollmentResponse)}"); - - - csrTrackingResponse = GetCertificateOnTimer(enrollmentResponse.RequestStatus.Id); - + Logger.Trace($"Renew Response JSON: {JsonConvert.SerializeObject(enrollmentResponse)}"); + + if (enrollmentResponse?.ErrorReturn?.Status != "Failure") + { + csrTrackingResponse = GetCertificateOnTimer(enrollmentResponse?.RequestStatus?.Id); + } + else + { + return new EnrollmentResult + { + Status = 30, //failure + StatusMessage = $"Enrollment Failed with error {enrollmentResponse?.ErrorReturn?.Error}" + }; + } break; - } - - return _requestManager.GetEnrollmentResult(csrTrackingResponse); + } + + + var cert = GetSingleRecord(csrTrackingResponse.Id.ToString()); + return _requestManager.GetEnrollmentResult(csrTrackingResponse,cert); } - private Certificate GetCertificateOnTimer(string Id) - { - //Get the csr tracking response from the tracking Id returned from Enrollment - var stopwatch = new Stopwatch(); - stopwatch.Start(); - - Certificate csrTrackingResponse = null; - - while (stopwatch.Elapsed < TimeSpan.FromSeconds(60) && csrTrackingResponse == null) - { - try - { - csrTrackingResponse = - Task.Run(async () => await HydrantIdClient.GetSubmitGetCertificateByCsrAsync(Id)) - .Result; - } - catch (System.AggregateException e) - { - Logger.Trace($"Enrollment Response Not Available Yet, try again {LogHandler.FlattenException(e)}."); - } - Thread.Sleep(1000); - } - - return csrTrackingResponse; + private Certificate GetCertificateOnTimer(string Id) + { + //Get the csr tracking response from the tracking Id returned from Enrollment + var stopwatch = new Stopwatch(); + stopwatch.Start(); + + Certificate csrTrackingResponse = null; + + while (stopwatch.Elapsed < TimeSpan.FromSeconds(30) && csrTrackingResponse == null) + { + try + { + csrTrackingResponse = + Task.Run(async () => await HydrantIdClient.GetSubmitGetCertificateByCsrAsync(Id)) + .Result; + } + catch (System.AggregateException e) + { + Logger.Trace($"Enrollment Response Not Available Yet, try again {LogHandler.FlattenException(e)}."); + } + Thread.Sleep(1000); + } + + return csrTrackingResponse; } public override CAConnectorCertificate GetSingleRecord(string caRequestId) diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IErrorReturn.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IErrorReturn.cs index 2e60da5..0c6c062 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IErrorReturn.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IErrorReturn.cs @@ -2,7 +2,7 @@ { public interface IErrorReturn { - int Status { get; set; } + string Status { get; set; } string Error { get; set; } } } \ No newline at end of file diff --git a/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs b/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs index aadecc7..3938ebb 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs @@ -224,12 +224,12 @@ public CertRequestBodySubjectAltNames GetSansRequest(Dictionary Date: Wed, 7 Jun 2023 11:05:41 -0700 Subject: [PATCH 05/19] 1.1.1 release (#7) * Update generated README --- .../workflows/keyfactor-starter-workflow.yml | 18 +++++++++++- .../HydrantIdProxy/Client/HydrantIdClient.cs | 9 ++++++ .../Client/Models/CertRequest.cs | 9 ++++++ .../Client/Models/CertRequestBody.cs | 9 ++++++ .../Models/CertRequestBodyDnComponents.cs | 9 ++++++ .../Models/CertRequestBodySubjectAltNames.cs | 9 ++++++ .../Client/Models/CertRequestBodyValidity.cs | 9 ++++++ .../Client/Models/CertRequestPolicy.cs | 9 ++++++ .../Client/Models/CertRequestResult.cs | 9 ++++++ .../Client/Models/CertRequestStatus.cs | 9 ++++++ .../Client/Models/CertRequestUser.cs | 9 ++++++ .../Client/Models/Certificate.cs | 9 ++++++ .../Client/Models/CertificateStatus.cs | 9 ++++++ .../Client/Models/CertificateUser.cs | 9 ++++++ .../Client/Models/Enums/IssuanceStatus.cs | 9 ++++++ .../Client/Models/Enums/RevocationReasons.cs | 9 ++++++ .../Models/Enums/RevocationStatusEnum.cs | 9 ++++++ .../Client/Models/Enums/SortDirectionEnum.cs | 9 ++++++ .../Client/Models/ErrorReturn.cs | 9 ++++++ .../Client/Models/GetCertificatesPayload.cs | 9 ++++++ .../Client/Models/GetCertificatesResponse.cs | 9 ++++++ .../Models/GetCertificatesResponseItem.cs | 9 ++++++ .../Client/Models/NameObject.cs | 9 ++++++ .../HydrantIdProxy/Client/Models/Policy.cs | 9 ++++++ .../Client/Models/PolicyDetails.cs | 9 ++++++ .../Models/PolicyDetailsCustomExtensions.cs | 9 ++++++ .../Models/PolicyDetailsCustomFields.cs | 9 ++++++ .../Models/PolicyDetailsDnComponents.cs | 9 ++++++ .../Models/PolicyDetailsExpiryEmails.cs | 9 ++++++ .../Models/PolicyDetailsSubjectAltNames.cs | 9 ++++++ .../Client/Models/PolicyDetailsValidity.cs | 9 ++++++ .../Client/Models/PolicyEnabled.cs | 9 ++++++ .../Client/Models/RenewalRequest.cs | 9 ++++++ .../Client/Models/RevokeCertificateReason.cs | 9 ++++++ .../Models/RevokeCertificateReasonIssuerDN.cs | 9 ++++++ .../src/HydrantIdProxy/Constants.cs | 9 ++++++ .../Exceptions/RetryCountExceededException.cs | 9 ++++++ .../RevokeReasonNotSupportedException.cs | 9 ++++++ .../Extensions/HttpClientExtensions.cs | 9 ++++++ .../src/HydrantIdProxy/HydrantIdProxy.cs | 9 ++++++ .../HydrantIdProxy/Interfaces/ICertRequest.cs | 9 ++++++ .../Interfaces/ICertRequestBody.cs | 9 ++++++ .../ICertRequestBodyDnComponents.cs | 9 ++++++ .../ICertRequestBodySubjectAltNames.cs | 9 ++++++ .../Interfaces/ICertRequestBodyValidity.cs | 9 ++++++ .../Interfaces/ICertRequestPolicy.cs | 9 ++++++ .../Interfaces/ICertRequestResult.cs | 9 ++++++ .../Interfaces/ICertRequestStatus.cs | 9 ++++++ .../Interfaces/ICertRequestUser.cs | 9 ++++++ .../HydrantIdProxy/Interfaces/ICertificate.cs | 9 ++++++ .../Interfaces/ICertificateStatus.cs | 9 ++++++ .../Interfaces/ICertificateUser.cs | 9 ++++++ .../Interfaces/ICertificatesPayload.cs | 9 ++++++ .../Interfaces/ICertificatesResponse.cs | 9 ++++++ .../Interfaces/ICertificatesResponseItem.cs | 9 ++++++ .../HydrantIdProxy/Interfaces/IErrorReturn.cs | 9 ++++++ .../Interfaces/IHawkCredential.cs | 9 ++++++ .../Interfaces/IHawkCredentialComment.cs | 9 ++++++ .../Interfaces/IHawkCredentialComments.cs | 9 ++++++ .../IHawkCredentialDeleteResults.cs | 9 ++++++ .../HydrantIdProxy/Interfaces/INameObject.cs | 9 ++++++ .../src/HydrantIdProxy/Interfaces/IPolicy.cs | 9 ++++++ .../Interfaces/IPolicyDetails.cs | 9 ++++++ .../IPolicyDetailsCustomExtensions.cs | 9 ++++++ .../Interfaces/IPolicyDetailsCustomFields.cs | 9 ++++++ .../Interfaces/IPolicyDetailsDnComponents.cs | 9 ++++++ .../Interfaces/IPolicyDetailsExpiryEmails.cs | 9 ++++++ .../IPolicyDetailsSubjectAltNames.cs | 9 ++++++ .../Interfaces/IPolicyDetailsValidity.cs | 9 ++++++ .../Interfaces/IPolicyEnabled.cs | 9 ++++++ .../Interfaces/IRenewalRequest.cs | 9 ++++++ .../Interfaces/IRenewalResponse.cs | 9 ++++++ .../Interfaces/IRevokeCertificateReason.cs | 9 ++++++ .../IRevokeCertificateReasonIssuerDn.cs | 9 ++++++ .../src/HydrantIdProxy/RequestManager.cs | 9 ++++++ README.md | 28 +++++++++++++++---- integration-manifest.json | 15 ++++++---- readme_source.md | 10 +++---- 78 files changed, 720 insertions(+), 17 deletions(-) diff --git a/.github/workflows/keyfactor-starter-workflow.yml b/.github/workflows/keyfactor-starter-workflow.yml index 2732486..996751d 100644 --- a/.github/workflows/keyfactor-starter-workflow.yml +++ b/.github/workflows/keyfactor-starter-workflow.yml @@ -5,6 +5,19 @@ jobs: call-create-github-release-workflow: uses: Keyfactor/actions/.github/workflows/github-release.yml@main + get-manifest-properties: + runs-on: windows-latest + outputs: + update_catalog: ${{ steps.read-json.outputs.prop }} + steps: + - uses: actions/checkout@v3 + - name: Read json + id: read-json + shell: pwsh + run: | + $json = Get-Content integration-manifest.json | ConvertFrom-Json + echo "::set-output name=prop::$(echo $json.update_catalog)" + call-dotnet-build-and-release-workflow: needs: [call-create-github-release-workflow] uses: Keyfactor/actions/.github/workflows/dotnet-build-and-release.yml@main @@ -18,9 +31,12 @@ jobs: call-generate-readme-workflow: if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' uses: Keyfactor/actions/.github/workflows/generate-readme.yml@main + secrets: + token: ${{ secrets.APPROVE_README_PUSH }} call-update-catalog-workflow: - if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' + needs: get-manifest-properties + if: needs.get-manifest-properties.outputs.update_catalog == 'True' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') uses: Keyfactor/actions/.github/workflows/update-catalog.yml@main secrets: token: ${{ secrets.SDK_SYNC_PAT }} diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/HydrantIdClient.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/HydrantIdClient.cs index 3fa72bb..c3443dc 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/HydrantIdClient.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/HydrantIdClient.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using System.Collections.Concurrent; using System.Collections.Generic; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequest.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequest.cs index de4e651..9b826e8 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequest.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequest.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using System.Collections.Generic; using System.Runtime.Serialization; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestBody.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestBody.cs index a5cbca6..5fe2e85 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestBody.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestBody.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using System.Collections.Generic; using Keyfactor.HydrantId.Interfaces; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestBodyDnComponents.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestBodyDnComponents.cs index 9b3728e..552dc67 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestBodyDnComponents.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestBodyDnComponents.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System.Collections.Generic; using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestBodySubjectAltNames.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestBodySubjectAltNames.cs index c1672e1..f2e2ff2 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestBodySubjectAltNames.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestBodySubjectAltNames.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System.Collections.Generic; using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestBodyValidity.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestBodyValidity.cs index 06bca5e..79f49ad 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestBodyValidity.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestBodyValidity.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestPolicy.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestPolicy.cs index 077a5a8..82c8a2d 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestPolicy.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestPolicy.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestResult.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestResult.cs index 84a5511..366d68b 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestResult.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestResult.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestStatus.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestStatus.cs index cd6f606..b11025a 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestStatus.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestStatus.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using System.Collections.Generic; using System.Runtime.Serialization; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestUser.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestUser.cs index ad106da..25c9d25 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestUser.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertRequestUser.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Certificate.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Certificate.cs index 7d11f13..4feba53 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Certificate.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Certificate.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using System.Collections.Generic; using Keyfactor.HydrantId.Client.Models.Enums; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertificateStatus.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertificateStatus.cs index e04626f..5a652f6 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertificateStatus.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertificateStatus.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using Keyfactor.HydrantId.Client.Models.Enums; using Keyfactor.HydrantId.Interfaces; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertificateUser.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertificateUser.cs index 0708783..587b94f 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertificateUser.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/CertificateUser.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Enums/IssuanceStatus.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Enums/IssuanceStatus.cs index 37e3e4b..a773885 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Enums/IssuanceStatus.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Enums/IssuanceStatus.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Enums/RevocationReasons.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Enums/RevocationReasons.cs index a846f0b..e12f639 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Enums/RevocationReasons.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Enums/RevocationReasons.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Enums/RevocationStatusEnum.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Enums/RevocationStatusEnum.cs index ff43244..82aff4b 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Enums/RevocationStatusEnum.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Enums/RevocationStatusEnum.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Enums/SortDirectionEnum.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Enums/SortDirectionEnum.cs index 48e15bf..fa628a5 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Enums/SortDirectionEnum.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Enums/SortDirectionEnum.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/ErrorReturn.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/ErrorReturn.cs index 0a3ecf9..50e1089 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/ErrorReturn.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/ErrorReturn.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/GetCertificatesPayload.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/GetCertificatesPayload.cs index e8bdafe..7fcd4c7 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/GetCertificatesPayload.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/GetCertificatesPayload.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using Keyfactor.HydrantId.Client.Models.Enums; using Keyfactor.HydrantId.Interfaces; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/GetCertificatesResponse.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/GetCertificatesResponse.cs index 582699c..4f7ee53 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/GetCertificatesResponse.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/GetCertificatesResponse.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System.Collections.Generic; using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/GetCertificatesResponseItem.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/GetCertificatesResponseItem.cs index 7430032..4af4222 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/GetCertificatesResponseItem.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/GetCertificatesResponseItem.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using System.Collections.Generic; using Keyfactor.HydrantId.Client.Models.Enums; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/NameObject.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/NameObject.cs index db513bd..cce49cb 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/NameObject.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/NameObject.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Policy.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Policy.cs index bc04226..2fa0934 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Policy.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/Policy.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetails.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetails.cs index cface17..85a64e6 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetails.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetails.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System.Collections.Generic; using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsCustomExtensions.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsCustomExtensions.cs index 1472fbc..06e8ae4 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsCustomExtensions.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsCustomExtensions.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsCustomFields.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsCustomFields.cs index c16e0cb..0213863 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsCustomFields.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsCustomFields.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsDnComponents.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsDnComponents.cs index 7632a99..d83b6af 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsDnComponents.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsDnComponents.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System.Runtime.Serialization; using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsExpiryEmails.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsExpiryEmails.cs index 290ab70..e4adaa8 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsExpiryEmails.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsExpiryEmails.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System.Runtime.Serialization; using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsSubjectAltNames.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsSubjectAltNames.cs index 07a13d5..e8a62fe 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsSubjectAltNames.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsSubjectAltNames.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System.Runtime.Serialization; using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsValidity.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsValidity.cs index 4bda0c0..da3cfd5 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsValidity.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyDetailsValidity.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; using System.Collections.Generic; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyEnabled.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyEnabled.cs index 5fbd52a..5c02a33 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyEnabled.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/PolicyEnabled.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/RenewalRequest.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/RenewalRequest.cs index 1641dbf..34b8fdf 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/RenewalRequest.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/RenewalRequest.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/RevokeCertificateReason.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/RevokeCertificateReason.cs index 1c7c0ca..3baa223 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/RevokeCertificateReason.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/RevokeCertificateReason.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using Keyfactor.HydrantId.Client.Models.Enums; using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/RevokeCertificateReasonIssuerDN.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/RevokeCertificateReasonIssuerDN.cs index 84048ab..9bbfdd8 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/Models/RevokeCertificateReasonIssuerDN.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/Models/RevokeCertificateReasonIssuerDN.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using Keyfactor.HydrantId.Client.Models.Enums; using Keyfactor.HydrantId.Interfaces; using Newtonsoft.Json; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Constants.cs b/HydrantIdProxy/src/HydrantIdProxy/Constants.cs index 28321b4..7880838 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Constants.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Constants.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. namespace Keyfactor.HydrantId { public class Constants diff --git a/HydrantIdProxy/src/HydrantIdProxy/Exceptions/RetryCountExceededException.cs b/HydrantIdProxy/src/HydrantIdProxy/Exceptions/RetryCountExceededException.cs index 49564c2..dea372c 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Exceptions/RetryCountExceededException.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Exceptions/RetryCountExceededException.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; namespace Keyfactor.HydrantId.Exceptions diff --git a/HydrantIdProxy/src/HydrantIdProxy/Exceptions/RevokeReasonNotSupportedException.cs b/HydrantIdProxy/src/HydrantIdProxy/Exceptions/RevokeReasonNotSupportedException.cs index f6a37e2..c1a1ca3 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Exceptions/RevokeReasonNotSupportedException.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Exceptions/RevokeReasonNotSupportedException.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; namespace Keyfactor.HydrantId.Exceptions diff --git a/HydrantIdProxy/src/HydrantIdProxy/Extensions/HttpClientExtensions.cs b/HydrantIdProxy/src/HydrantIdProxy/Extensions/HttpClientExtensions.cs index 0998d7f..9431d9b 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Extensions/HttpClientExtensions.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Extensions/HttpClientExtensions.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using System.Diagnostics; using System.Net.Http; diff --git a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs index 5c4cc18..e92f2f5 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using System.Collections.Concurrent; using System.Collections.Generic; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequest.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequest.cs index 47a7188..36b00c4 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequest.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequest.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using System.Collections.Generic; using Keyfactor.HydrantId.Client.Models; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestBody.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestBody.cs index 96b647d..3e66f35 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestBody.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestBody.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using System.Collections.Generic; using Keyfactor.HydrantId.Client.Models; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestBodyDnComponents.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestBodyDnComponents.cs index 74386aa..e617c5e 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestBodyDnComponents.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestBodyDnComponents.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System.Collections.Generic; namespace Keyfactor.HydrantId.Interfaces diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestBodySubjectAltNames.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestBodySubjectAltNames.cs index f7973b9..b00f43e 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestBodySubjectAltNames.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestBodySubjectAltNames.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System.Collections.Generic; namespace Keyfactor.HydrantId.Interfaces diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestBodyValidity.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestBodyValidity.cs index a6d4cc9..94e6e83 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestBodyValidity.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestBodyValidity.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. namespace Keyfactor.HydrantId.Interfaces { public interface ICertRequestBodyValidity diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestPolicy.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestPolicy.cs index 9193b0f..5824de4 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestPolicy.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestPolicy.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; namespace Keyfactor.HydrantId.Interfaces diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestResult.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestResult.cs index 8337f70..86c577e 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestResult.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestResult.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using Keyfactor.HydrantId.Client.Models; namespace Keyfactor.HydrantId.Interfaces diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestStatus.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestStatus.cs index 5d8b183..5dd8645 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestStatus.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestStatus.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using System.Collections.Generic; using Keyfactor.HydrantId.Client.Models; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestUser.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestUser.cs index cd7461e..41761c2 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestUser.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertRequestUser.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; namespace Keyfactor.HydrantId.Interfaces diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificate.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificate.cs index 792eb0d..ee2cd4e 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificate.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificate.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using System.Collections.Generic; using Keyfactor.HydrantId.Client.Models; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificateStatus.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificateStatus.cs index df796b8..9478af2 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificateStatus.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificateStatus.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using Keyfactor.HydrantId.Client.Models.Enums; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificateUser.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificateUser.cs index c8d3fd9..243cb5a 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificateUser.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificateUser.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; namespace Keyfactor.HydrantId.Interfaces diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificatesPayload.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificatesPayload.cs index 021258d..f5126a8 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificatesPayload.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificatesPayload.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using Keyfactor.HydrantId.Client.Models.Enums; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificatesResponse.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificatesResponse.cs index d07805d..be985a5 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificatesResponse.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificatesResponse.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System.Collections.Generic; using Keyfactor.HydrantId.Client.Models; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificatesResponseItem.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificatesResponseItem.cs index f12b65e..4956505 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificatesResponseItem.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/ICertificatesResponseItem.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using System.Collections.Generic; using Keyfactor.HydrantId.Client.Models; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IErrorReturn.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IErrorReturn.cs index 0c6c062..0edffa9 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IErrorReturn.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IErrorReturn.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. namespace Keyfactor.HydrantId.Interfaces { public interface IErrorReturn diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IHawkCredential.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IHawkCredential.cs index 6a22c55..d3e2912 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IHawkCredential.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IHawkCredential.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; namespace Keyfactor.HydrantId.Interfaces diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IHawkCredentialComment.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IHawkCredentialComment.cs index 8c36eb0..37a8f17 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IHawkCredentialComment.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IHawkCredentialComment.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. namespace Keyfactor.HydrantId.Interfaces { public interface IHawkCredentialComment diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IHawkCredentialComments.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IHawkCredentialComments.cs index 0737706..791c64d 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IHawkCredentialComments.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IHawkCredentialComments.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. namespace Keyfactor.HydrantId.Interfaces { public interface IHawkCredentialComments diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IHawkCredentialDeleteResults.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IHawkCredentialDeleteResults.cs index 1cccbcf..8b17063 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IHawkCredentialDeleteResults.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IHawkCredentialDeleteResults.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. namespace Keyfactor.HydrantId.Interfaces { public interface IHawkCredentialDeleteResults diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/INameObject.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/INameObject.cs index 380c685..2b82794 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/INameObject.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/INameObject.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. namespace Keyfactor.HydrantId.Interfaces { public interface INameObject diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicy.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicy.cs index 00707aa..e7339bb 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicy.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicy.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using Keyfactor.HydrantId.Client.Models; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetails.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetails.cs index 945dea9..20682b1 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetails.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetails.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System.Collections.Generic; using Keyfactor.HydrantId.Client.Models; diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsCustomExtensions.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsCustomExtensions.cs index 5b62235..9731b7d 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsCustomExtensions.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsCustomExtensions.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. namespace Keyfactor.HydrantId.Interfaces { public interface IPolicyDetailsCustomExtensions diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsCustomFields.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsCustomFields.cs index 1c8d310..eb41f8c 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsCustomFields.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsCustomFields.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. namespace Keyfactor.HydrantId.Interfaces { public interface IPolicyDetailsCustomFields diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsDnComponents.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsDnComponents.cs index 74dfab8..ae15ad9 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsDnComponents.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsDnComponents.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using Keyfactor.HydrantId.Client.Models; namespace Keyfactor.HydrantId.Interfaces diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsExpiryEmails.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsExpiryEmails.cs index 5a37b2a..36f5e06 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsExpiryEmails.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsExpiryEmails.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using Keyfactor.HydrantId.Client.Models; namespace Keyfactor.HydrantId.Interfaces diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsSubjectAltNames.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsSubjectAltNames.cs index 382ae84..f4dceac 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsSubjectAltNames.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsSubjectAltNames.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using Keyfactor.HydrantId.Client.Models; namespace Keyfactor.HydrantId.Interfaces diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsValidity.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsValidity.cs index cc6081c..42badb5 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsValidity.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyDetailsValidity.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System.Collections.Generic; namespace Keyfactor.HydrantId.Interfaces diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyEnabled.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyEnabled.cs index 2897bc2..6cd8a3d 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyEnabled.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IPolicyEnabled.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. namespace Keyfactor.HydrantId.Interfaces { public interface IPolicyEnabled diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IRenewalRequest.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IRenewalRequest.cs index 574686c..0fe3088 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IRenewalRequest.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IRenewalRequest.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. namespace Keyfactor.HydrantId.Interfaces { public interface IRenewalRequest diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IRenewalResponse.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IRenewalResponse.cs index 550ee16..041791f 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IRenewalResponse.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IRenewalResponse.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. namespace Keyfactor.HydrantId.Interfaces { public interface IRenewalResponse diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IRevokeCertificateReason.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IRevokeCertificateReason.cs index 16ee55f..a2e0bc4 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IRevokeCertificateReason.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IRevokeCertificateReason.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using Keyfactor.HydrantId.Client.Models.Enums; namespace Keyfactor.HydrantId.Interfaces diff --git a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IRevokeCertificateReasonIssuerDn.cs b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IRevokeCertificateReasonIssuerDn.cs index 02a2f33..4513640 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IRevokeCertificateReasonIssuerDn.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Interfaces/IRevokeCertificateReasonIssuerDn.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using Keyfactor.HydrantId.Client.Models.Enums; namespace Keyfactor.HydrantId.Interfaces diff --git a/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs b/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs index 3938ebb..0ee8768 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs @@ -1,3 +1,12 @@ +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. using System; using System.Collections.Generic; using System.IO; diff --git a/README.md b/README.md index 099d433..8d85d5b 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,24 @@ This repository contains an AnyGateway CA Connector, which is a plugin to the Ke +## Support for HydrantId + +HydrantId is supported by Keyfactor for Keyfactor customers. If you have a support issue, please open a support ticket with your Keyfactor representative. + +###### To report a problem or suggest a new feature, use the **[Issues](../../issues)** tab. If you want to contribute actual bug fixes or proposed enhancements, use the **[Pull requests](../../pulls)** tab. + + + +--- + + + + + + + + +--- *** @@ -62,7 +80,7 @@ To install the gateway follow these instructions. ### Set-KeyfactorGatewayEncryptionCert This cmdlet will generate a self-signed certificate used to encrypt the database connection string. It populates a registry value with the serial number of the certificate to be used. The certificate is stored in the LocalMachine Personal Store and the registry key populated is: - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CertSvcProxy\Parameters\EncryptSerialNumber + ```HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CertSvcProxy\Parameters\EncryptSerialNumber``` No parameters are required to run this cmdlet. 5) Gateway Server - Run the following Powershell Script to Set the Database Connection @@ -85,14 +103,14 @@ To install the gateway follow these instructions. ## HydrantId AnyGateway Specific Configuration -It is important to note that importing the HydrantId configuration into the CA Gateway prior to installing the binaries must be completed. Additionally, the CA Gateway service +It is important to note that importing the HydrantId configuration into the CA Gateway after installing the binaries must be completed. Additionally, the CA Gateway service must be running in order to succesfully import the configuation. When the CA Gateway service starts it will attempt to validate the connection information to the CA. Without the imported configuration, the service will fail to start. ### Binary Installation 1) Get the Latest Zip File from [Here](https://github.com/Keyfactor/hydrantid-cagateway/releases/) -2) Gateway Server - Copy the HawkNet.dll, They HydrantIdProxy.dll and the HydrantIdProxy.dll.config to the location where the Gateway Framework was installed (usually C:\Program Files\Keyfactor\Keyfactor AnyGateway) +2) Gateway Server - Copy the HawkNet.dll, The HydrantIdProxy.dll and the HydrantIdProxy.dll.config to the location where the Gateway Framework was installed (usually C:\Program Files\Keyfactor\Keyfactor AnyGateway) ### Configuration Changes 1) Gateway Server - Edit the CAProxyServer.exe.config file and replace the line that says "NoOp" with the line below: @@ -154,9 +172,9 @@ the CA. Without the imported configuration, the service will fail to start. 1) Command Server - Copy and Unzip the Template Setup Files located [Here](https://github.com/Keyfactor/hydrantid-cagateway/raw/main/TemplateSetup.zip) 2) Command Server - Change the Security Settings in the CaTemplateUserSecurity.csv file to the appropriate settings for Test or Production 3) Command Server - Run the CreateTemplate.ps1 file and choose option 1 to create the templates in active directory. - *Note if you get errors the security is likely wrong and you will have to add the security manually according to Keyfactor standards* + *Note if you get errors the URL to the API or Security is likely wrong. Make sure the API calls are run with an administrator user in KF Command* 4) Command Server - Use the Keyfactor Portal to Import the Templates created in Active Directory in step #3 above - *Note You will have to override the default API Questions to the appropriate information.* + *Note there are default values for the API Url, UserId, and Password. You will have to override the default API Questions to the appropriate values.* ### Certificate Authority Installation 1) Gateway Server - Start the Keyfactor Gateway Service diff --git a/integration-manifest.json b/integration-manifest.json index d859c0d..61487bf 100644 --- a/integration-manifest.json +++ b/integration-manifest.json @@ -1,8 +1,11 @@ { - "$schema": "https://keyfactor.github.io/integration-manifest-schema.json", - "integration_type": "ca-gateway", - "name": "HydrantId", - "status": "production", - "description": "HydrantId operates a PKI as a service platform for customers around the globe. The AnyGateway solution for HydrantId is designed to allow Keyfactor Command the ability to: - Sync certificates issued from the CA - Request new certificates from the CA - Revoke certificates directly from Keyfactor Command -Renew or Reissue Certificates from the CA", - "link_github": true + "$schema": "https://keyfactor.github.io/integration-manifest-schema.json", + "integration_type": "ca-gateway", + "name": "HydrantId", + "status": "production", + "description": "HydrantId operates a PKI as a service platform for customers around the globe. The AnyGateway solution for HydrantId is designed to allow Keyfactor Command the ability to: - Sync certificates issued from the CA - Request new certificates from the CA - Revoke certificates directly from Keyfactor Command -Renew or Reissue Certificates from the CA", + "link_github": true, + "update_catalog": true, + "support_level": "kf-supported" + } diff --git a/readme_source.md b/readme_source.md index 32cc223..4a8a1fb 100644 --- a/readme_source.md +++ b/readme_source.md @@ -48,7 +48,7 @@ To install the gateway follow these instructions. ### Set-KeyfactorGatewayEncryptionCert This cmdlet will generate a self-signed certificate used to encrypt the database connection string. It populates a registry value with the serial number of the certificate to be used. The certificate is stored in the LocalMachine Personal Store and the registry key populated is: - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CertSvcProxy\Parameters\EncryptSerialNumber + ```HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CertSvcProxy\Parameters\EncryptSerialNumber``` No parameters are required to run this cmdlet. 5) Gateway Server - Run the following Powershell Script to Set the Database Connection @@ -71,14 +71,14 @@ To install the gateway follow these instructions. ## HydrantId AnyGateway Specific Configuration -It is important to note that importing the HydrantId configuration into the CA Gateway prior to installing the binaries must be completed. Additionally, the CA Gateway service +It is important to note that importing the HydrantId configuration into the CA Gateway after installing the binaries must be completed. Additionally, the CA Gateway service must be running in order to succesfully import the configuation. When the CA Gateway service starts it will attempt to validate the connection information to the CA. Without the imported configuration, the service will fail to start. ### Binary Installation 1) Get the Latest Zip File from [Here](https://github.com/Keyfactor/hydrantid-cagateway/releases/) -2) Gateway Server - Copy the HawkNet.dll, They HydrantIdProxy.dll and the HydrantIdProxy.dll.config to the location where the Gateway Framework was installed (usually C:\Program Files\Keyfactor\Keyfactor AnyGateway) +2) Gateway Server - Copy the HawkNet.dll, The HydrantIdProxy.dll and the HydrantIdProxy.dll.config to the location where the Gateway Framework was installed (usually C:\Program Files\Keyfactor\Keyfactor AnyGateway) ### Configuration Changes 1) Gateway Server - Edit the CAProxyServer.exe.config file and replace the line that says "NoOp" with the line below: @@ -140,9 +140,9 @@ the CA. Without the imported configuration, the service will fail to start. 1) Command Server - Copy and Unzip the Template Setup Files located [Here](https://github.com/Keyfactor/hydrantid-cagateway/raw/main/TemplateSetup.zip) 2) Command Server - Change the Security Settings in the CaTemplateUserSecurity.csv file to the appropriate settings for Test or Production 3) Command Server - Run the CreateTemplate.ps1 file and choose option 1 to create the templates in active directory. - *Note if you get errors the security is likely wrong and you will have to add the security manually according to Keyfactor standards* + *Note if you get errors the URL to the API or Security is likely wrong. Make sure the API calls are run with an administrator user in KF Command* 4) Command Server - Use the Keyfactor Portal to Import the Templates created in Active Directory in step #3 above - *Note You will have to override the default API Questions to the appropriate information.* + *Note there are default values for the API Url, UserId, and Password. You will have to override the default API Questions to the appropriate values.* ### Certificate Authority Installation 1) Gateway Server - Start the Keyfactor Gateway Service From 38c6168b75b9341f7f4144b7ae36cd891b755d72 Mon Sep 17 00:00:00 2001 From: Brian Hill Date: Wed, 21 Jun 2023 16:45:47 -0400 Subject: [PATCH 06/19] Recompile against latest Gateway Framework --- HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.csproj | 8 ++++---- HydrantIdProxy/src/HydrantIdProxy/app.config | 2 +- HydrantIdProxy/src/HydrantIdProxy/packages.config | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.csproj b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.csproj index 160e0d8..5a0fdbc 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.csproj +++ b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.csproj @@ -30,8 +30,8 @@ 4 - - ..\..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll + + ..\..\packages\BouncyCastle.1.8.9\lib\BouncyCastle.Crypto.dll ..\..\packages\Keyfactor.AnyGateway.SDK.21.3.2\lib\net462\CAProxy.AnyGateway.Core.dll @@ -51,8 +51,8 @@ ..\..\packages\Keyfactor.AnyGateway.SDK.21.3.2\lib\net462\CommonCAProxy.dll - - ..\..\packages\CSS.Common.1.6.0\lib\net462\CSS.Common.dll + + ..\..\packages\CSS.Common.1.7.0\lib\net462\CSS.Common.dll ..\..\packages\CSS.PKI.2.13.0\lib\net462\CSS.PKI.dll diff --git a/HydrantIdProxy/src/HydrantIdProxy/app.config b/HydrantIdProxy/src/HydrantIdProxy/app.config index 1febf8c..01c583d 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/app.config +++ b/HydrantIdProxy/src/HydrantIdProxy/app.config @@ -12,7 +12,7 @@ - + diff --git a/HydrantIdProxy/src/HydrantIdProxy/packages.config b/HydrantIdProxy/src/HydrantIdProxy/packages.config index a517475..b06c2e9 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/packages.config +++ b/HydrantIdProxy/src/HydrantIdProxy/packages.config @@ -1,16 +1,16 @@  - - + + From 5e1f57fbbd5ae687ff14894dfa168feebf593dfd Mon Sep 17 00:00:00 2001 From: Keyfactor Date: Wed, 21 Jun 2023 20:46:32 +0000 Subject: [PATCH 07/19] Update generated README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8d85d5b..4fdd9b8 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,14 @@ HydrantId operates a PKI as a service platform for customers around the globe. #### Integration status: Production - Ready for use in production environments. + ## About the Keyfactor AnyGateway CA Connector This repository contains an AnyGateway CA Connector, which is a plugin to the Keyfactor AnyGateway. AnyGateway CA Connectors allow Keyfactor Command to be used for inventory, issuance, and revocation of certificates from a third-party certificate authority. + ## Support for HydrantId HydrantId is supported by Keyfactor for Keyfactor customers. If you have a support issue, please open a support ticket with your Keyfactor representative. From 17339946794e7d6bace729bcda5079b3852f9e11 Mon Sep 17 00:00:00 2001 From: Brian Hill <76450501+bhillkeyfactor@users.noreply.github.com> Date: Mon, 26 Jun 2023 09:10:15 -0400 Subject: [PATCH 08/19] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f3a28e..631ad69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +v1.1.2 +- Recompiled agains the latest gateway and Bouncy Castle Frameworks + v1.1.1 - Fixed error handing to match Hydrant new API Structure From 9f1bc978c5c0fbe6b3bd23fcb85691558d4a7571 Mon Sep 17 00:00:00 2001 From: Brian Hill Date: Mon, 26 Jun 2023 11:29:44 -0400 Subject: [PATCH 09/19] Fixed Build Errors --- .../src/HydrantIdProxy/HydrantIdProxy.csproj | 4 ++-- HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs | 4 ++-- HydrantIdProxy/src/HydrantIdProxy/app.config | 2 +- HydrantIdProxy/src/HydrantIdProxy/packages.config | 10 ++++------ 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.csproj b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.csproj index 5a0fdbc..e1fdf42 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.csproj +++ b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.csproj @@ -30,8 +30,8 @@ 4 - - ..\..\packages\BouncyCastle.1.8.9\lib\BouncyCastle.Crypto.dll + + ..\..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll ..\..\packages\Keyfactor.AnyGateway.SDK.21.3.2\lib\net462\CAProxy.AnyGateway.Core.dll diff --git a/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs b/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs index 0ee8768..6b5ee7c 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs @@ -7,7 +7,7 @@ // OR CONDITIONS OF ANY KIND, either express or implied. See the License for // thespecific language governing permissions and limitations under the // License. -using System; +using System; using System.Collections.Generic; using System.IO; using CAProxy.AnyGateway.Models; @@ -16,9 +16,9 @@ using Keyfactor.HydrantId.Client.Models; using Keyfactor.HydrantId.Client.Models.Enums; using Keyfactor.HydrantId.Interfaces; -using Org.BouncyCastle.Pkcs; using Keyfactor.HydrantId.Exceptions; using Org.BouncyCastle.OpenSsl; +using Org.BouncyCastle.Pkcs; namespace Keyfactor.HydrantId { diff --git a/HydrantIdProxy/src/HydrantIdProxy/app.config b/HydrantIdProxy/src/HydrantIdProxy/app.config index 01c583d..9be735f 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/app.config +++ b/HydrantIdProxy/src/HydrantIdProxy/app.config @@ -8,7 +8,7 @@ - + diff --git a/HydrantIdProxy/src/HydrantIdProxy/packages.config b/HydrantIdProxy/src/HydrantIdProxy/packages.config index b06c2e9..3c9fe6d 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/packages.config +++ b/HydrantIdProxy/src/HydrantIdProxy/packages.config @@ -1,14 +1,12 @@  - + - - - - + + - + From 401c546c6aa9a2120fba7bc6b7ec8b8dc198c5b8 Mon Sep 17 00:00:00 2001 From: Keyfactor Date: Fri, 27 Oct 2023 15:44:22 +0000 Subject: [PATCH 10/19] Update generated README --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 4fdd9b8..199bd7f 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,6 @@ HydrantId operates a PKI as a service platform for customers around the globe. This repository contains an AnyGateway CA Connector, which is a plugin to the Keyfactor AnyGateway. AnyGateway CA Connectors allow Keyfactor Command to be used for inventory, issuance, and revocation of certificates from a third-party certificate authority. - - ## Support for HydrantId HydrantId is supported by Keyfactor for Keyfactor customers. If you have a support issue, please open a support ticket with your Keyfactor representative. @@ -19,7 +17,6 @@ HydrantId is supported by Keyfactor for Keyfactor customers. If you have a suppo ###### To report a problem or suggest a new feature, use the **[Issues](../../issues)** tab. If you want to contribute actual bug fixes or proposed enhancements, use the **[Pull requests](../../pulls)** tab. - --- From ad161927f5c08ee46f983be1d432cfb957b18ce0 Mon Sep 17 00:00:00 2001 From: KFAdmin Date: Mon, 30 Oct 2023 19:41:09 +0000 Subject: [PATCH 11/19] Compiled against latest version and fixed error when no cert is ever available for download after 30 seconds --- .../src/HydrantIdProxy/HydrantIdProxy.cs | 12 ++++++- .../src/HydrantIdProxy/HydrantIdProxy.csproj | 4 +-- HydrantIdProxy/src/HydrantIdProxy/app.config | 36 +++++++++---------- .../src/HydrantIdProxy/packages.config | 26 +++++++------- 4 files changed, 43 insertions(+), 35 deletions(-) diff --git a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs index e92f2f5..f5509f5 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs @@ -179,7 +179,7 @@ public override EnrollmentResult Enroll(ICertificateDataReader certificateDataRe { Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); CertRequestResult enrollmentResponse = null; - + int timerTries = 0; Certificate csrTrackingResponse=null; switch (enrollmentType) @@ -208,6 +208,7 @@ public override EnrollmentResult Enroll(ICertificateDataReader certificateDataRe if (enrollmentResponse?.ErrorReturn?.Status != "Failure") { + timerTries = +1; csrTrackingResponse = GetCertificateOnTimer(enrollmentResponse?.RequestStatus?.Id); } else @@ -248,6 +249,7 @@ await HydrantIdClient.GetSubmitRenewalAsync(certificateId, renewalRequest)) if (enrollmentResponse?.ErrorReturn?.Status != "Failure") { + timerTries = +1; csrTrackingResponse = GetCertificateOnTimer(enrollmentResponse?.RequestStatus?.Id); } else @@ -261,6 +263,14 @@ await HydrantIdClient.GetSubmitRenewalAsync(certificateId, renewalRequest)) break; } + if(csrTrackingResponse==null && timerTries>0) + { + return new EnrollmentResult + { + Status = 30, //failure + StatusMessage = $"Certificate may still waiting on Hydrant and is not ready for download" + }; + } var cert = GetSingleRecord(csrTrackingResponse.Id.ToString()); return _requestManager.GetEnrollmentResult(csrTrackingResponse,cert); diff --git a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.csproj b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.csproj index e1fdf42..c1646fa 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.csproj +++ b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.csproj @@ -30,8 +30,8 @@ 4 - - ..\..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll + + ..\..\packages\Portable.BouncyCastle.1.8.9\lib\net40\BouncyCastle.Crypto.dll ..\..\packages\Keyfactor.AnyGateway.SDK.21.3.2\lib\net462\CAProxy.AnyGateway.Core.dll diff --git a/HydrantIdProxy/src/HydrantIdProxy/app.config b/HydrantIdProxy/src/HydrantIdProxy/app.config index 9be735f..e7bfe44 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/app.config +++ b/HydrantIdProxy/src/HydrantIdProxy/app.config @@ -1,19 +1,19 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/HydrantIdProxy/src/HydrantIdProxy/packages.config b/HydrantIdProxy/src/HydrantIdProxy/packages.config index 3c9fe6d..594601f 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/packages.config +++ b/HydrantIdProxy/src/HydrantIdProxy/packages.config @@ -1,15 +1,13 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + \ No newline at end of file From 1179682df6c45d36eff60c206f10ad19288f9dac Mon Sep 17 00:00:00 2001 From: Keyfactor Date: Mon, 30 Oct 2023 19:42:20 +0000 Subject: [PATCH 12/19] Update generated README --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 4fdd9b8..199bd7f 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,6 @@ HydrantId operates a PKI as a service platform for customers around the globe. This repository contains an AnyGateway CA Connector, which is a plugin to the Keyfactor AnyGateway. AnyGateway CA Connectors allow Keyfactor Command to be used for inventory, issuance, and revocation of certificates from a third-party certificate authority. - - ## Support for HydrantId HydrantId is supported by Keyfactor for Keyfactor customers. If you have a support issue, please open a support ticket with your Keyfactor representative. @@ -19,7 +17,6 @@ HydrantId is supported by Keyfactor for Keyfactor customers. If you have a suppo ###### To report a problem or suggest a new feature, use the **[Issues](../../issues)** tab. If you want to contribute actual bug fixes or proposed enhancements, use the **[Pull requests](../../pulls)** tab. - --- From b29a922ea7fd3a377cc4cd252098237cad5acc34 Mon Sep 17 00:00:00 2001 From: Brian Hill <76450501+bhillkeyfactor@users.noreply.github.com> Date: Wed, 8 Nov 2023 10:35:22 -0500 Subject: [PATCH 13/19] Recompile (#11) * Updated Template install instructions * fixed package references --------- Co-authored-by: Keyfactor --- .../src/HydrantIdProxy/HydrantIdProxy.csproj | 7 ++-- .../src/HydrantIdProxy/packages.config | 3 ++ README.md | 32 +++++++++++++++---- readme_source.md | 32 +++++++++++++++---- 4 files changed, 57 insertions(+), 17 deletions(-) diff --git a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.csproj b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.csproj index c1646fa..3d26feb 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.csproj +++ b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.csproj @@ -30,8 +30,8 @@ 4 - - ..\..\packages\Portable.BouncyCastle.1.8.9\lib\net40\BouncyCastle.Crypto.dll + + ..\..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll ..\..\packages\Keyfactor.AnyGateway.SDK.21.3.2\lib\net462\CAProxy.AnyGateway.Core.dll @@ -60,9 +60,6 @@ ..\..\packages\HawkNet.1.4.4.0\lib\net45\HawkNet.dll - - ..\..\packages\JsonSubTypes.1.8.0\lib\net46\JsonSubTypes.dll - ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/HydrantIdProxy/src/HydrantIdProxy/packages.config b/HydrantIdProxy/src/HydrantIdProxy/packages.config index 594601f..398501b 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/packages.config +++ b/HydrantIdProxy/src/HydrantIdProxy/packages.config @@ -1,8 +1,11 @@  + + + diff --git a/README.md b/README.md index 199bd7f..70d0912 100644 --- a/README.md +++ b/README.md @@ -168,12 +168,32 @@ the CA. Without the imported configuration, the service will fail to start. ### Template Installation -1) Command Server - Copy and Unzip the Template Setup Files located [Here](https://github.com/Keyfactor/hydrantid-cagateway/raw/main/TemplateSetup.zip) -2) Command Server - Change the Security Settings in the CaTemplateUserSecurity.csv file to the appropriate settings for Test or Production -3) Command Server - Run the CreateTemplate.ps1 file and choose option 1 to create the templates in active directory. - *Note if you get errors the URL to the API or Security is likely wrong. Make sure the API calls are run with an administrator user in KF Command* -4) Command Server - Use the Keyfactor Portal to Import the Templates created in Active Directory in step #3 above - *Note there are default values for the API Url, UserId, and Password. You will have to override the default API Questions to the appropriate values.* +The Template section will map the CA's products to an AD template. +* ```ProductID``` +This is the ID of the HydrantId product to map to the specified template. If you don't know the available product IDs in your Hydrant account, put a placeholder value here and run the Set-KeyfactorGatewayConfig cmdlet according to the AnyGateway documentation. The list of available product IDs will be returned. +* ```ValidityPeriod``` +REQUIRED: The period to use when requesting certs. It could be, Days, Months, Years depending on the Template. +* ```ValidityUnits``` +REQUIRED: The numeric value corresponding to the ValidityPeriod. For years 1 would be 1 year, for days 7 would be 7 days. + + ```json + "Templates": { + "AutoEnrollment - RSA": { + "ProductID": "AutoEnrollment - RSA", + "Parameters": { + "ValidityPeriod": "Years", + "ValidityUnits": 1 + } + }, + "AutoEnrollment - RSA - 7 Day": { + "ProductID": "AutoEnrollment - RSA - 7 Day", + "Parameters": { + "ValidityPeriod": "Days", + "ValidityUnits": 7 + } + } + } + ``` ### Certificate Authority Installation 1) Gateway Server - Start the Keyfactor Gateway Service diff --git a/readme_source.md b/readme_source.md index 4a8a1fb..1771e70 100644 --- a/readme_source.md +++ b/readme_source.md @@ -137,12 +137,32 @@ the CA. Without the imported configuration, the service will fail to start. ### Template Installation -1) Command Server - Copy and Unzip the Template Setup Files located [Here](https://github.com/Keyfactor/hydrantid-cagateway/raw/main/TemplateSetup.zip) -2) Command Server - Change the Security Settings in the CaTemplateUserSecurity.csv file to the appropriate settings for Test or Production -3) Command Server - Run the CreateTemplate.ps1 file and choose option 1 to create the templates in active directory. - *Note if you get errors the URL to the API or Security is likely wrong. Make sure the API calls are run with an administrator user in KF Command* -4) Command Server - Use the Keyfactor Portal to Import the Templates created in Active Directory in step #3 above - *Note there are default values for the API Url, UserId, and Password. You will have to override the default API Questions to the appropriate values.* +The Template section will map the CA's products to an AD template. +* ```ProductID``` +This is the ID of the HydrantId product to map to the specified template. If you don't know the available product IDs in your Hydrant account, put a placeholder value here and run the Set-KeyfactorGatewayConfig cmdlet according to the AnyGateway documentation. The list of available product IDs will be returned. +* ```ValidityPeriod``` +REQUIRED: The period to use when requesting certs. It could be, Days, Months, Years depending on the Template. +* ```ValidityUnits``` +REQUIRED: The numeric value corresponding to the ValidityPeriod. For years 1 would be 1 year, for days 7 would be 7 days. + + ```json + "Templates": { + "AutoEnrollment - RSA": { + "ProductID": "AutoEnrollment - RSA", + "Parameters": { + "ValidityPeriod": "Years", + "ValidityUnits": 1 + } + }, + "AutoEnrollment - RSA - 7 Day": { + "ProductID": "AutoEnrollment - RSA - 7 Day", + "Parameters": { + "ValidityPeriod": "Days", + "ValidityUnits": 7 + } + } + } + ``` ### Certificate Authority Installation 1) Gateway Server - Start the Keyfactor Gateway Service From 269ba722300a47244fa74acb2e014fb26c4aab16 Mon Sep 17 00:00:00 2001 From: Keyfactor Date: Wed, 8 Nov 2023 15:51:11 +0000 Subject: [PATCH 14/19] Update generated README --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f870c1e..39c4d00 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ HydrantId operates a PKI as a service platform for customers around the globe. This repository contains an AnyGateway CA Connector, which is a plugin to the Keyfactor AnyGateway. AnyGateway CA Connectors allow Keyfactor Command to be used for inventory, issuance, and revocation of certificates from a third-party certificate authority. -======= ## Support for HydrantId HydrantId is supported by Keyfactor for Keyfactor customers. If you have a support issue, please open a support ticket with your Keyfactor representative. @@ -18,6 +17,19 @@ HydrantId is supported by Keyfactor for Keyfactor customers. If you have a suppo ###### To report a problem or suggest a new feature, use the **[Issues](../../issues)** tab. If you want to contribute actual bug fixes or proposed enhancements, use the **[Pull requests](../../pulls)** tab. +--- + + + + + + + + +--- + + +*** # Getting Started ## Standard Gateway Installation To begin, you must have the CA Gateway Service 21.3.2 installed and operational before attempting to configure the HydrantId plugin. This integration was tested with Keyfactor 9.3.0.0. From 0765de426a54e21b62445a8b9ee3a550a5910294 Mon Sep 17 00:00:00 2001 From: Mikey Henderson Date: Thu, 16 Nov 2023 12:42:56 -0800 Subject: [PATCH 15/19] Updated Template install instructions * Update generated README * fixed package references * Recompile (fixing 1.1.2) (#14) * Delete (de-referenced) TemplateSetup.zip --------- --- CHANGELOG.md | 1 + .../src/HydrantIdProxy/HydrantIdProxy.cs | 603 +++++++-------- .../src/HydrantIdProxy/RequestManager.cs | 686 +++++++++--------- README.md | 7 - TemplateSetup.zip | Bin 4264 -> 0 bytes readme_source.md | 7 - 6 files changed, 651 insertions(+), 653 deletions(-) delete mode 100644 TemplateSetup.zip diff --git a/CHANGELOG.md b/CHANGELOG.md index 2192d88..631ad69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ v1.1.2 - Recompiled agains the latest gateway and Bouncy Castle Frameworks + v1.1.1 - Fixed error handing to match Hydrant new API Structure diff --git a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs index 5904370..f5509f5 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/HydrantIdProxy.cs @@ -1,211 +1,209 @@ -// Copyright 2023 Keyfactor -// Licensed under the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. You may obtain a -// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless -// required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES -// OR CONDITIONS OF ANY KIND, either express or implied. See the License for -// thespecific language governing permissions and limitations under the -// License. -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using CAProxy.AnyGateway; -using CAProxy.AnyGateway.Interfaces; -using CAProxy.AnyGateway.Models; -using CAProxy.Common; -using CSS.Common; -using CSS.Common.Logging; -using CSS.PKI; -using Keyfactor.HydrantId.Client; -using Keyfactor.HydrantId.Client.Models; -using Keyfactor.HydrantId.Interfaces; -using Newtonsoft.Json; - -namespace Keyfactor.HydrantId -{ - public class HydrantIdProxy : BaseCAConnector - { - private readonly RequestManager _requestManager; - - public HydrantIdProxy() - { - _requestManager = new RequestManager(); - } - - public HydrantIdClient HydrantIdClient { get; set; } - public bool EnableTemplateSync { get; set; } - - public override int Revoke(string caRequestId, string hexSerialNumber, uint revocationReason) - { - try - { - Logger.Trace("Staring Revoke Method"); - - var hydrantId = caRequestId.Substring(0, 36); - var revokeReason = _requestManager.GetMapRevokeReasons(revocationReason); - - Logger.Trace($"Revoke Reason {revokeReason}"); - - var revokeResponse = Task.Run(async () => - await HydrantIdClient.GetSubmitRevokeCertificateAsync(hydrantId, revokeReason)) - .Result; - - Logger.Trace($"Revoke Response JSON: {JsonConvert.SerializeObject(revokeResponse)}"); - Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); - return 1; - } - catch (Exception e) - { - Logger.Error($"An Error has occurred during the revoke process {e.Message}"); - Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); - return -1; - } - } - - [Obsolete] - public override void Synchronize(ICertificateDataReader certificateDataReader, - BlockingCollection blockingBuffer, - CertificateAuthoritySyncInfo certificateAuthoritySyncInfo, CancellationToken cancelToken, - string logicalName) - { - } - - public override void Synchronize(ICertificateDataReader certificateDataReader, - BlockingCollection blockingBuffer, - CertificateAuthoritySyncInfo certificateAuthoritySyncInfo, - CancellationToken cancelToken) - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - try - { - var certs = new BlockingCollection(100); - _ = HydrantIdClient.GetSubmitCertificateListRequestAsync(certs, cancelToken); - - foreach (var currentResponseItem in certs.GetConsumingEnumerable(cancelToken)) - { - if (cancelToken.IsCancellationRequested) - { - Logger.Error("Synchronize was canceled."); - break; - } - - try - { - Logger.Trace($"Took Certificate ID {currentResponseItem?.Id} from Queue"); - if (currentResponseItem != null) - { - var certStatus = _requestManager.GetMapReturnStatus(currentResponseItem.RevocationStatus); - Logger.Trace($"Numeric Status {certStatus}"); - - if (certStatus == Convert.ToInt32(PKIConstants.Microsoft.RequestDisposition.ISSUED) || - certStatus == Convert.ToInt32(PKIConstants.Microsoft.RequestDisposition.REVOKED)) - { - var productId = currentResponseItem.Policy.Name; - Logger.Trace($"Product Id {productId}"); - - var singleCert = HydrantIdClient.GetSubmitGetCertificateAsync(currentResponseItem.Id); - - var fileContent = singleCert.Result.Pem ?? string.Empty; - - Logger.Trace($"Certificate Content: {fileContent}"); - - if (fileContent.Length > 0) - { - var certData = fileContent.Replace("\n", string.Empty); - var splitCerts = - certData.Split( - new[] {"-----END CERTIFICATE-----", "-----BEGIN CERTIFICATE-----"}, - StringSplitOptions.RemoveEmptyEntries); - foreach (var cert in splitCerts) - try - { +using System.Linq; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using CAProxy.AnyGateway; +using CAProxy.AnyGateway.Interfaces; +using CAProxy.AnyGateway.Models; +using CAProxy.Common; +using CSS.Common; +using CSS.Common.Logging; +using CSS.PKI; +using Keyfactor.HydrantId.Client; +using Keyfactor.HydrantId.Client.Models; +using Keyfactor.HydrantId.Interfaces; +using Newtonsoft.Json; + +namespace Keyfactor.HydrantId +{ + public class HydrantIdProxy : BaseCAConnector + { + private readonly RequestManager _requestManager; + + public HydrantIdProxy() + { + _requestManager = new RequestManager(); + } + + public HydrantIdClient HydrantIdClient { get; set; } + public bool EnableTemplateSync { get; set; } + + public override int Revoke(string caRequestId, string hexSerialNumber, uint revocationReason) + { + try + { + Logger.Trace("Staring Revoke Method"); + + var hydrantId = caRequestId.Substring(0, 36); + var revokeReason = _requestManager.GetMapRevokeReasons(revocationReason); + + Logger.Trace($"Revoke Reason {revokeReason}"); + + var revokeResponse = Task.Run(async () => + await HydrantIdClient.GetSubmitRevokeCertificateAsync(hydrantId, revokeReason)) + .Result; + + Logger.Trace($"Revoke Response JSON: {JsonConvert.SerializeObject(revokeResponse)}"); + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); + return 1; + } + catch (Exception e) + { + Logger.Error($"An Error has occurred during the revoke process {e.Message}"); + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); + return -1; + } + } + + [Obsolete] + public override void Synchronize(ICertificateDataReader certificateDataReader, + BlockingCollection blockingBuffer, + CertificateAuthoritySyncInfo certificateAuthoritySyncInfo, CancellationToken cancelToken, + string logicalName) + { + } + + public override void Synchronize(ICertificateDataReader certificateDataReader, + BlockingCollection blockingBuffer, + CertificateAuthoritySyncInfo certificateAuthoritySyncInfo, + CancellationToken cancelToken) + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + try + { + var certs = new BlockingCollection(100); + _ = HydrantIdClient.GetSubmitCertificateListRequestAsync(certs, cancelToken); + + foreach (var currentResponseItem in certs.GetConsumingEnumerable(cancelToken)) + { + if (cancelToken.IsCancellationRequested) + { + Logger.Error("Synchronize was canceled."); + break; + } + + try + { + Logger.Trace($"Took Certificate ID {currentResponseItem?.Id} from Queue"); + if (currentResponseItem != null) + { + var certStatus = _requestManager.GetMapReturnStatus(currentResponseItem.RevocationStatus); + Logger.Trace($"Numeric Status {certStatus}"); + + if (certStatus == Convert.ToInt32(PKIConstants.Microsoft.RequestDisposition.ISSUED) || + certStatus == Convert.ToInt32(PKIConstants.Microsoft.RequestDisposition.REVOKED)) + { + var productId = currentResponseItem.Policy.Name; + Logger.Trace($"Product Id {productId}"); + + var singleCert = HydrantIdClient.GetSubmitGetCertificateAsync(currentResponseItem.Id); + + var fileContent = singleCert.Result.Pem ?? string.Empty; + + Logger.Trace($"Certificate Content: {fileContent}"); + + if (fileContent.Length > 0) + { + var certData = fileContent.Replace("\n", string.Empty); + var splitCerts = + certData.Split( + new[] {"-----END CERTIFICATE-----", "-----BEGIN CERTIFICATE-----"}, + StringSplitOptions.RemoveEmptyEntries); + foreach (var cert in splitCerts) + try + { var currentCert = new X509Certificate2(Encoding.ASCII.GetBytes(cert)); - var caReqId = $"{currentResponseItem.Id}-{currentCert.SerialNumber}"; - Logger.Trace($"Split Cert Value: {cert}"); - blockingBuffer.Add(new CAConnectorCertificate - { - CARequestID =$"{currentResponseItem.Id}", - Certificate = cert, - SubmissionDate = Convert.ToDateTime(singleCert.Result.CreatedAt), - Status = certStatus, - ProductID = productId - }, cancelToken); - } - catch (Exception e) - { - Logger.Error( - $"Exception occurred Adding Cert to buffer: {e.Message} HydrantId: {currentResponseItem.Id} CommonName: {currentResponseItem.CommonName} Serial: {currentResponseItem.Serial}"); - } - } - } - } - } - catch (OperationCanceledException) - { - Logger.Error("Synchronize was canceled."); - break; - } - } - } - catch (AggregateException aggEx) - { - Logger.Error("Csc Global Synchronize Task failed!"); - Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); - // ReSharper disable once PossibleIntendedRethrow - throw aggEx; - } - - Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); - } - - [Obsolete] - public override EnrollmentResult Enroll(string csr, string subject, Dictionary san, - EnrollmentProductInfo productInfo, - PKIConstants.X509.RequestFormat requestFormat, RequestUtilities.EnrollmentType enrollmentType) - { - return null; - } - - public override EnrollmentResult Enroll(ICertificateDataReader certificateDataReader, string csr, - string subject, Dictionary san, EnrollmentProductInfo productInfo, - PKIConstants.X509.RequestFormat requestFormat, RequestUtilities.EnrollmentType enrollmentType) - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - CertRequestResult enrollmentResponse = null; - int timerTries = 0; - Certificate csrTrackingResponse=null; - - Certificate csrTrackingResponse=null; - - switch (enrollmentType) - { - case RequestUtilities.EnrollmentType.New: - case RequestUtilities.EnrollmentType.Reissue: - Logger.Trace("Entering New Enrollment"); - - var policyListResult = - Task.Run(async () => await HydrantIdClient.GetPolicyList()) - .Result; - - Logger.Trace($"Policy Result List: {JsonConvert.SerializeObject(policyListResult)}"); - var policyId = policyListResult.Single(p => p.Name.Equals(productInfo.ProductID)); - - Logger.Trace($"PolicyId: {JsonConvert.SerializeObject(policyId)}"); - - var enrollmentRequest = - _requestManager.GetEnrollmentRequest(policyId.Id, productInfo, csr, san); - - Logger.Trace($"Enrollment Request JSON: {JsonConvert.SerializeObject(enrollmentRequest)}"); - enrollmentResponse = - Task.Run(async () => await HydrantIdClient.GetSubmitEnrollmentAsync(enrollmentRequest)) - .Result; + var caReqId = $"{currentResponseItem.Id}-{currentCert.SerialNumber}"; + Logger.Trace($"Split Cert Value: {cert}"); + blockingBuffer.Add(new CAConnectorCertificate + { + CARequestID =$"{currentResponseItem.Id}", + Certificate = cert, + SubmissionDate = Convert.ToDateTime(singleCert.Result.CreatedAt), + Status = certStatus, + ProductID = productId + }, cancelToken); + } + catch (Exception e) + { + Logger.Error( + $"Exception occurred Adding Cert to buffer: {e.Message} HydrantId: {currentResponseItem.Id} CommonName: {currentResponseItem.CommonName} Serial: {currentResponseItem.Serial}"); + } + } + } + } + } + catch (OperationCanceledException) + { + Logger.Error("Synchronize was canceled."); + break; + } + } + } + catch (AggregateException aggEx) + { + Logger.Error("Csc Global Synchronize Task failed!"); + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); + // ReSharper disable once PossibleIntendedRethrow + throw aggEx; + } + + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); + } + + [Obsolete] + public override EnrollmentResult Enroll(string csr, string subject, Dictionary san, + EnrollmentProductInfo productInfo, + PKIConstants.X509.RequestFormat requestFormat, RequestUtilities.EnrollmentType enrollmentType) + { + return null; + } + + public override EnrollmentResult Enroll(ICertificateDataReader certificateDataReader, string csr, + string subject, Dictionary san, EnrollmentProductInfo productInfo, + PKIConstants.X509.RequestFormat requestFormat, RequestUtilities.EnrollmentType enrollmentType) + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + CertRequestResult enrollmentResponse = null; + int timerTries = 0; + Certificate csrTrackingResponse=null; + + switch (enrollmentType) + { + case RequestUtilities.EnrollmentType.New: + case RequestUtilities.EnrollmentType.Reissue: + Logger.Trace("Entering New Enrollment"); + + var policyListResult = + Task.Run(async () => await HydrantIdClient.GetPolicyList()) + .Result; + + Logger.Trace($"Policy Result List: {JsonConvert.SerializeObject(policyListResult)}"); + var policyId = policyListResult.Single(p => p.Name.Equals(productInfo.ProductID)); + + Logger.Trace($"PolicyId: {JsonConvert.SerializeObject(policyId)}"); + + var enrollmentRequest = + _requestManager.GetEnrollmentRequest(policyId.Id, productInfo, csr, san); + + Logger.Trace($"Enrollment Request JSON: {JsonConvert.SerializeObject(enrollmentRequest)}"); + enrollmentResponse = + Task.Run(async () => await HydrantIdClient.GetSubmitEnrollmentAsync(enrollmentRequest)) + .Result; Logger.Trace($"Enrollment Response JSON: {JsonConvert.SerializeObject(enrollmentResponse)}"); if (enrollmentResponse?.ErrorReturn?.Status != "Failure") @@ -223,35 +221,48 @@ public override EnrollmentResult Enroll(ICertificateDataReader certificateDataRe } - Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); - - break; - - case RequestUtilities.EnrollmentType.Renew: - Logger.Trace("Entering Renew..."); - - var renewalRequest = _requestManager.GetRenewalRequest(csr, false); - Logger.Trace($"Renewal Request JSON: {JsonConvert.SerializeObject(renewalRequest)}"); - var sn = productInfo.ProductParameters["PriorCertSN"]; - Logger.Trace($"Prior Cert Serial Number= {sn}"); - var priorCert = certificateDataReader.GetCertificateRecord( - DataConversion.HexToBytes(sn)); - - var uUId = priorCert.CARequestID; //uUId is a GUID - - Logger.Trace($"Hydrant Certificate Id Plus Serial #= {uUId}"); - - Logger.Trace($"Reissue CA RequestId: {uUId}"); - var certificateId = uUId.Substring(0, 36); - enrollmentResponse = - Task.Run(async () => - await HydrantIdClient.GetSubmitRenewalAsync(certificateId, renewalRequest)) - .Result; + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); + + break; + + case RequestUtilities.EnrollmentType.Renew: + Logger.Trace("Entering Renew..."); + + var renewalRequest = _requestManager.GetRenewalRequest(csr, false); + Logger.Trace($"Renewal Request JSON: {JsonConvert.SerializeObject(renewalRequest)}"); + var sn = productInfo.ProductParameters["PriorCertSN"]; + Logger.Trace($"Prior Cert Serial Number= {sn}"); + var priorCert = certificateDataReader.GetCertificateRecord( + DataConversion.HexToBytes(sn)); + + var uUId = priorCert.CARequestID; //uUId is a GUID + + Logger.Trace($"Hydrant Certificate Id Plus Serial #= {uUId}"); + + Logger.Trace($"Reissue CA RequestId: {uUId}"); + var certificateId = uUId.Substring(0, 36); + enrollmentResponse = + Task.Run(async () => + await HydrantIdClient.GetSubmitRenewalAsync(certificateId, renewalRequest)) + .Result; Logger.Trace($"Renew Response JSON: {JsonConvert.SerializeObject(enrollmentResponse)}"); if (enrollmentResponse?.ErrorReturn?.Status != "Failure") { timerTries = +1; + csrTrackingResponse = GetCertificateOnTimer(enrollmentResponse?.RequestStatus?.Id); + } + else + { + return new EnrollmentResult + { + Status = 30, //failure + StatusMessage = $"Enrollment Failed with error {enrollmentResponse?.ErrorReturn?.Error}" + }; + } + break; + } + if(csrTrackingResponse==null && timerTries>0) { return new EnrollmentResult @@ -261,10 +272,10 @@ await HydrantIdClient.GetSubmitRenewalAsync(certificateId, renewalRequest)) }; } - var cert = GetSingleRecord(csrTrackingResponse.Id.ToString()); - return _requestManager.GetEnrollmentResult(csrTrackingResponse,cert); - } - + var cert = GetSingleRecord(csrTrackingResponse.Id.ToString()); + return _requestManager.GetEnrollmentResult(csrTrackingResponse,cert); + } + private Certificate GetCertificateOnTimer(string Id) { //Get the csr tracking response from the tracking Id returned from Enrollment @@ -289,66 +300,66 @@ private Certificate GetCertificateOnTimer(string Id) } return csrTrackingResponse; - } - - public override CAConnectorCertificate GetSingleRecord(string caRequestId) - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - Logger.Trace($"Keyfactor Ca Id: {caRequestId}"); - try - { - var certificateResponse = - Task.Run(async () => - await HydrantIdClient.GetSubmitGetCertificateAsync(caRequestId.Substring(0, 36))) - .Result; - - Logger.Trace($"Single Cert JSON: {JsonConvert.SerializeObject(certificateResponse)}"); - Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); - return new CAConnectorCertificate - { - CARequestID = caRequestId, - Certificate = certificateResponse.Pem, - ResolutionDate = Convert.ToDateTime(certificateResponse.NotAfter), - Status = _requestManager.GetMapReturnStatus(certificateResponse.RevocationStatus), - SubmissionDate = Convert.ToDateTime(certificateResponse.CreatedAt) - }; - } - catch (Exception) //Most likely cert is not available yet, just get it on the sync - { - return new CAConnectorCertificate - { - CARequestID = caRequestId, - Status = _requestManager.GetMapReturnStatus(0) //Unknown - }; - } - } - - public override void Initialize(ICAConnectorConfigProvider configProvider) - { - try - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - HydrantIdClient = new HydrantIdClient(configProvider); - Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); - } - catch (Exception e) - { - Logger.Error($"Error Occured in HydrantIdProxy.Initialize: {e.Message}"); - throw; - } - } - - public override void Ping() - { - } - - public override void ValidateCAConnectionInfo(Dictionary connectionInfo) - { - } - - public override void ValidateProductInfo(EnrollmentProductInfo productInfo, - Dictionary connectionInfo) - { - } - } + } + + public override CAConnectorCertificate GetSingleRecord(string caRequestId) + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + Logger.Trace($"Keyfactor Ca Id: {caRequestId}"); + try + { + var certificateResponse = + Task.Run(async () => + await HydrantIdClient.GetSubmitGetCertificateAsync(caRequestId.Substring(0, 36))) + .Result; + + Logger.Trace($"Single Cert JSON: {JsonConvert.SerializeObject(certificateResponse)}"); + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); + return new CAConnectorCertificate + { + CARequestID = caRequestId, + Certificate = certificateResponse.Pem, + ResolutionDate = Convert.ToDateTime(certificateResponse.NotAfter), + Status = _requestManager.GetMapReturnStatus(certificateResponse.RevocationStatus), + SubmissionDate = Convert.ToDateTime(certificateResponse.CreatedAt) + }; + } + catch (Exception) //Most likely cert is not available yet, just get it on the sync + { + return new CAConnectorCertificate + { + CARequestID = caRequestId, + Status = _requestManager.GetMapReturnStatus(0) //Unknown + }; + } + } + + public override void Initialize(ICAConnectorConfigProvider configProvider) + { + try + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + HydrantIdClient = new HydrantIdClient(configProvider); + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); + } + catch (Exception e) + { + Logger.Error($"Error Occured in HydrantIdProxy.Initialize: {e.Message}"); + throw; + } + } + + public override void Ping() + { + } + + public override void ValidateCAConnectionInfo(Dictionary connectionInfo) + { + } + + public override void ValidateProductInfo(EnrollmentProductInfo productInfo, + Dictionary connectionInfo) + { + } + } } \ No newline at end of file diff --git a/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs b/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs index 25aff76..6b5ee7c 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/RequestManager.cs @@ -1,262 +1,262 @@ -// Copyright 2023 Keyfactor -// Licensed under the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. You may obtain a -// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless -// required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES -// OR CONDITIONS OF ANY KIND, either express or implied. See the License for -// thespecific language governing permissions and limitations under the -// License. -using System; -using System.Collections.Generic; -using System.IO; -using CAProxy.AnyGateway.Models; -using CSS.Common.Logging; -using CSS.PKI; -using Keyfactor.HydrantId.Client.Models; -using Keyfactor.HydrantId.Client.Models.Enums; -using Keyfactor.HydrantId.Interfaces; -using Keyfactor.HydrantId.Exceptions; -using Org.BouncyCastle.OpenSsl; -using Org.BouncyCastle.Pkcs; - -namespace Keyfactor.HydrantId -{ - public class RequestManager : LoggingClientBase - { - public int GetMapReturnStatus(RevocationStatusEnum hydrantIdStatus) - { - try - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - PKIConstants.Microsoft.RequestDisposition returnStatus; - Logger.Trace($"hydrantIdStatus: {hydrantIdStatus}"); - switch (hydrantIdStatus) - { - case RevocationStatusEnum.Valid: - returnStatus = PKIConstants.Microsoft.RequestDisposition.ISSUED; - break; - case RevocationStatusEnum.Pending: - returnStatus = PKIConstants.Microsoft.RequestDisposition.PENDING; - break; - case RevocationStatusEnum.Revoked: - returnStatus = PKIConstants.Microsoft.RequestDisposition.REVOKED; - break; - default: - returnStatus = PKIConstants.Microsoft.RequestDisposition.UNKNOWN; - break; - } - Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); - return Convert.ToInt32(returnStatus); - } - catch (Exception e) - { - Logger.Error($"Error Occured in RequestManager.GetMapReturnStatus: {e.Message}"); - throw; - } - } - - public RevocationReasons GetMapRevokeReasons(uint keyfactorRevokeReason) - { - - try - { - RevocationReasons returnStatus = RevocationReasons.KeyCompromise; - if (keyfactorRevokeReason == 1 | keyfactorRevokeReason == 3 | keyfactorRevokeReason == 4 | keyfactorRevokeReason == 5) - { - - switch (keyfactorRevokeReason) - { - case 1: - returnStatus = RevocationReasons.KeyCompromise; - break; - case 3: - returnStatus = RevocationReasons.AffiliationChanged; - break; - case 4: - returnStatus = RevocationReasons.Superseded; - break; - case 5: - returnStatus = RevocationReasons.CessationOfOperation; - break; - } - - return returnStatus; - } - - throw new RevokeReasonNotSupportedException("This Revoke Reason is not Supported"); - - } - catch(Exception e) - { - Logger.Error($"Error Occured in RequestManager.GetMapRevokeReasons: {e.Message}"); - throw; - } - } - - public RevokeCertificateReason GetRevokeRequest(RevocationReasons reason) - { - try - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - return new RevokeCertificateReason - { - Reason = reason - }; - } - - catch (Exception e) - { - Logger.Error($"Error Occured in RequestManager.GetRevokeRequest: {e.Message}"); - throw; - } - } - - public CertificatesPayload GetCertificatesListRequest(int offset,int limit) - { - try - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - return new CertificatesPayload - { - Limit = limit, - Offset = offset, - Status = 0, - Expired = true - }; - } - catch (Exception e) - { - Logger.Error($"Error Occured in RequestManager.GetCertificatesListRequest: {e.Message}"); - throw; - } - } - - public CertRequestBody GetEnrollmentRequest(Guid? policyId,EnrollmentProductInfo productInfo, string csr, Dictionary san) - { - try - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - if (san.ContainsKey("dns")) - { - return new CertRequestBody - { - Policy = policyId, - Csr = csr, - DnComponents = GetDnComponentsRequest(csr), - SubjectAltNames = GetSansRequest(san), - Validity = GetValidity(productInfo.ProductParameters["ValidityPeriod"],Convert.ToInt16(productInfo.ProductParameters["ValidityUnits"])) - }; - } - - return new CertRequestBody - { - Policy = policyId, - Csr = csr, - DnComponents = GetDnComponentsRequest(csr), - Validity=GetValidity(productInfo.ProductParameters["ValidityPeriod"], Convert.ToInt16(productInfo.ProductParameters["ValidityUnits"])) - }; - } - catch (Exception e) - { - Logger.Error($"Error Occured in RequestManager.GetEnrollmentRequest: {e.Message}"); - throw; - } - } - - public RenewalRequest GetRenewalRequest(string csr, bool reuseCsr) - { - try - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - return new RenewalRequest - { - Csr = csr, - ReuseCsr = reuseCsr - }; - } - catch (Exception e) - { - Logger.Error($"Error Occured in RequestManager.GetRenewalRequest: {e.Message}"); - throw; - } - } - - private CertRequestBodyValidity GetValidity(string period,int units) - { - try - { +// Copyright 2023 Keyfactor +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain a +// copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless +// required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES +// OR CONDITIONS OF ANY KIND, either express or implied. See the License for +// thespecific language governing permissions and limitations under the +// License. +using System; +using System.Collections.Generic; +using System.IO; +using CAProxy.AnyGateway.Models; +using CSS.Common.Logging; +using CSS.PKI; +using Keyfactor.HydrantId.Client.Models; +using Keyfactor.HydrantId.Client.Models.Enums; +using Keyfactor.HydrantId.Interfaces; +using Keyfactor.HydrantId.Exceptions; +using Org.BouncyCastle.OpenSsl; +using Org.BouncyCastle.Pkcs; + +namespace Keyfactor.HydrantId +{ + public class RequestManager : LoggingClientBase + { + public int GetMapReturnStatus(RevocationStatusEnum hydrantIdStatus) + { + try + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + PKIConstants.Microsoft.RequestDisposition returnStatus; + Logger.Trace($"hydrantIdStatus: {hydrantIdStatus}"); + switch (hydrantIdStatus) + { + case RevocationStatusEnum.Valid: + returnStatus = PKIConstants.Microsoft.RequestDisposition.ISSUED; + break; + case RevocationStatusEnum.Pending: + returnStatus = PKIConstants.Microsoft.RequestDisposition.PENDING; + break; + case RevocationStatusEnum.Revoked: + returnStatus = PKIConstants.Microsoft.RequestDisposition.REVOKED; + break; + default: + returnStatus = PKIConstants.Microsoft.RequestDisposition.UNKNOWN; + break; + } + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); + return Convert.ToInt32(returnStatus); + } + catch (Exception e) + { + Logger.Error($"Error Occured in RequestManager.GetMapReturnStatus: {e.Message}"); + throw; + } + } + + public RevocationReasons GetMapRevokeReasons(uint keyfactorRevokeReason) + { + + try + { + RevocationReasons returnStatus = RevocationReasons.KeyCompromise; + if (keyfactorRevokeReason == 1 | keyfactorRevokeReason == 3 | keyfactorRevokeReason == 4 | keyfactorRevokeReason == 5) + { + + switch (keyfactorRevokeReason) + { + case 1: + returnStatus = RevocationReasons.KeyCompromise; + break; + case 3: + returnStatus = RevocationReasons.AffiliationChanged; + break; + case 4: + returnStatus = RevocationReasons.Superseded; + break; + case 5: + returnStatus = RevocationReasons.CessationOfOperation; + break; + } + + return returnStatus; + } + + throw new RevokeReasonNotSupportedException("This Revoke Reason is not Supported"); + + } + catch(Exception e) + { + Logger.Error($"Error Occured in RequestManager.GetMapRevokeReasons: {e.Message}"); + throw; + } + } + + public RevokeCertificateReason GetRevokeRequest(RevocationReasons reason) + { + try + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + return new RevokeCertificateReason + { + Reason = reason + }; + } + + catch (Exception e) + { + Logger.Error($"Error Occured in RequestManager.GetRevokeRequest: {e.Message}"); + throw; + } + } + + public CertificatesPayload GetCertificatesListRequest(int offset,int limit) + { + try + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + return new CertificatesPayload + { + Limit = limit, + Offset = offset, + Status = 0, + Expired = true + }; + } + catch (Exception e) + { + Logger.Error($"Error Occured in RequestManager.GetCertificatesListRequest: {e.Message}"); + throw; + } + } + + public CertRequestBody GetEnrollmentRequest(Guid? policyId,EnrollmentProductInfo productInfo, string csr, Dictionary san) + { + try + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + if (san.ContainsKey("dns")) + { + return new CertRequestBody + { + Policy = policyId, + Csr = csr, + DnComponents = GetDnComponentsRequest(csr), + SubjectAltNames = GetSansRequest(san), + Validity = GetValidity(productInfo.ProductParameters["ValidityPeriod"],Convert.ToInt16(productInfo.ProductParameters["ValidityUnits"])) + }; + } + + return new CertRequestBody + { + Policy = policyId, + Csr = csr, + DnComponents = GetDnComponentsRequest(csr), + Validity=GetValidity(productInfo.ProductParameters["ValidityPeriod"], Convert.ToInt16(productInfo.ProductParameters["ValidityUnits"])) + }; + } + catch (Exception e) + { + Logger.Error($"Error Occured in RequestManager.GetEnrollmentRequest: {e.Message}"); + throw; + } + } + + public RenewalRequest GetRenewalRequest(string csr, bool reuseCsr) + { + try + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + return new RenewalRequest + { + Csr = csr, + ReuseCsr = reuseCsr + }; + } + catch (Exception e) + { + Logger.Error($"Error Occured in RequestManager.GetRenewalRequest: {e.Message}"); + throw; + } + } + + private CertRequestBodyValidity GetValidity(string period,int units) + { + try + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + CertRequestBodyValidity validity = new CertRequestBodyValidity(); + switch(period) + { + case "Years": + validity.Years = units; + break; + case "Months": + validity.Months = units; + break; + case "Days": + validity.Days = units; + break; + } + + return validity; + } + catch (Exception e) + { + Logger.Error($"Error Occured in RequestManager.GetValidity: {e.Message}"); + throw; + } + } + + public CertRequestBodySubjectAltNames GetSansRequest(Dictionary sans) + { + try + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + var san = new CertRequestBodySubjectAltNames(); + List dnsNames = new List(); + foreach (var v in sans["dns"]) + { + dnsNames.Add(v); + } + san.Dnsname=dnsNames; + return san; + } + catch (Exception e) + { + Logger.Error($"Error Occured in RequestManager.GetSansRequest: {e.Message}"); + throw; + } + } + + public EnrollmentResult + GetEnrollmentResult( + ICertificate enrollmentResult, CAConnectorCertificate cert) + { + try + { Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - CertRequestBodyValidity validity = new CertRequestBodyValidity(); - switch(period) - { - case "Years": - validity.Years = units; - break; - case "Months": - validity.Months = units; - break; - case "Days": - validity.Days = units; - break; - } - - return validity; - } - catch (Exception e) - { - Logger.Error($"Error Occured in RequestManager.GetValidity: {e.Message}"); - throw; - } - } - - public CertRequestBodySubjectAltNames GetSansRequest(Dictionary sans) - { - try - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - var san = new CertRequestBodySubjectAltNames(); - List dnsNames = new List(); - foreach (var v in sans["dns"]) - { - dnsNames.Add(v); - } - san.Dnsname=dnsNames; - return san; - } - catch (Exception e) - { - Logger.Error($"Error Occured in RequestManager.GetSansRequest: {e.Message}"); - throw; - } - } - - public EnrollmentResult - GetEnrollmentResult( - ICertificate enrollmentResult, CAConnectorCertificate cert) - { - try - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - if (enrollmentResult==null) - { - return new EnrollmentResult - { - Status = 30, //failure - StatusMessage = $"Enrollment Failed with could not get the certificate from the request tracking id" - }; - } - - if (!enrollmentResult.Id.HasValue) - { - return new EnrollmentResult - { - Status = 30, //failure - StatusMessage = $"Enrollment Failed with could not get the certificate from the request tracking id" - }; + if (enrollmentResult==null) + { + return new EnrollmentResult + { + Status = 30, //failure + StatusMessage = $"Enrollment Failed with could not get the certificate from the request tracking id" + }; + } + + if (!enrollmentResult.Id.HasValue) + { + return new EnrollmentResult + { + Status = 30, //failure + StatusMessage = $"Enrollment Failed with could not get the certificate from the request tracking id" + }; } - if (enrollmentResult.Id.HasValue) + if (enrollmentResult.Id.HasValue) { return new EnrollmentResult { @@ -264,90 +264,90 @@ public EnrollmentResult CARequestID = enrollmentResult.Id.ToString(), Certificate = cert.Certificate, StatusMessage = $"Order Successfully Created With Product {cert.ProductID}" - }; - } - - return null; - } - catch (Exception e) - { - Logger.Error($"Error Occured in RequestManager.GetEnrollmentResult: {e.Message}"); - throw; - } - } - - public static Func Pemify = ss => - ss.Length <= 64 ? ss : ss.Substring(0, 64) + "\n" + Pemify(ss.Substring(64)); - - public CertRequestBodyDnComponents GetDnComponentsRequest(string csr) - { - try - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - var c = String.Empty; - var o = String.Empty; - var cn = string.Empty; - var l = string.Empty; - var st = string.Empty; - var ou = string.Empty; - - Logger.Trace($"CSR: {csr}"); - var cert = "-----BEGIN CERTIFICATE REQUEST-----\r\n"; - cert = cert + Pemify(csr); - cert = cert + "\r\n-----END CERTIFICATE REQUEST-----"; - Logger.Trace($"cert: {cert}"); - - var reader = new PemReader(new StringReader(cert)); - if (reader.ReadObject() is Pkcs10CertificationRequest req) - { - var info = req.GetCertificationRequestInfo(); - Logger.Trace($"subject: {info.Subject}"); - - var array1 = info.Subject.ToString().Split(','); - foreach (var x in array1) - { - var itemArray = x.Split('='); - - switch (itemArray[0].ToUpper()) - { - case "C": - c = itemArray[1]; - break; - case "O": - o = itemArray[1]; - break; - case "CN": - cn = itemArray[1]; - break; - case "OU": - ou = itemArray[1]; - break; - case "ST": - st = itemArray[1]; - break; - case "L": - l = itemArray[1]; - break; - } - } - } - - return new CertRequestBodyDnComponents - { - Cn = cn, - Ou = new List{ou}, - O=o, - L=l, - St = st, - C=c - }; - } - catch (Exception e) - { - Logger.Error($"Error Occured in RequestManager.GetDnComponentsRequest: {e.Message}"); - throw; - } - } - } -} - + }; + } + + return null; + } + catch (Exception e) + { + Logger.Error($"Error Occured in RequestManager.GetEnrollmentResult: {e.Message}"); + throw; + } + } + + public static Func Pemify = ss => + ss.Length <= 64 ? ss : ss.Substring(0, 64) + "\n" + Pemify(ss.Substring(64)); + + public CertRequestBodyDnComponents GetDnComponentsRequest(string csr) + { + try + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + var c = String.Empty; + var o = String.Empty; + var cn = string.Empty; + var l = string.Empty; + var st = string.Empty; + var ou = string.Empty; + + Logger.Trace($"CSR: {csr}"); + var cert = "-----BEGIN CERTIFICATE REQUEST-----\r\n"; + cert = cert + Pemify(csr); + cert = cert + "\r\n-----END CERTIFICATE REQUEST-----"; + Logger.Trace($"cert: {cert}"); + + var reader = new PemReader(new StringReader(cert)); + if (reader.ReadObject() is Pkcs10CertificationRequest req) + { + var info = req.GetCertificationRequestInfo(); + Logger.Trace($"subject: {info.Subject}"); + + var array1 = info.Subject.ToString().Split(','); + foreach (var x in array1) + { + var itemArray = x.Split('='); + + switch (itemArray[0].ToUpper()) + { + case "C": + c = itemArray[1]; + break; + case "O": + o = itemArray[1]; + break; + case "CN": + cn = itemArray[1]; + break; + case "OU": + ou = itemArray[1]; + break; + case "ST": + st = itemArray[1]; + break; + case "L": + l = itemArray[1]; + break; + } + } + } + + return new CertRequestBodyDnComponents + { + Cn = cn, + Ou = new List{ou}, + O=o, + L=l, + St = st, + C=c + }; + } + catch (Exception e) + { + Logger.Error($"Error Occured in RequestManager.GetDnComponentsRequest: {e.Message}"); + throw; + } + } + } +} + diff --git a/README.md b/README.md index 39c4d00..70d0912 100644 --- a/README.md +++ b/README.md @@ -194,13 +194,6 @@ REQUIRED: The numeric value corresponding to the ValidityPeriod. For years 1 wou } } ``` -======= -1) Command Server - Copy and Unzip the Template Setup Files located [Here](https://github.com/Keyfactor/hydrantid-cagateway/raw/main/TemplateSetup.zip) -2) Command Server - Change the Security Settings in the CaTemplateUserSecurity.csv file to the appropriate settings for Test or Production -3) Command Server - Run the CreateTemplate.ps1 file and choose option 1 to create the templates in active directory. - *Note if you get errors the URL to the API or Security is likely wrong. Make sure the API calls are run with an administrator user in KF Command* -4) Command Server - Use the Keyfactor Portal to Import the Templates created in Active Directory in step #3 above - *Note there are default values for the API Url, UserId, and Password. You will have to override the default API Questions to the appropriate values.* ### Certificate Authority Installation 1) Gateway Server - Start the Keyfactor Gateway Service diff --git a/TemplateSetup.zip b/TemplateSetup.zip deleted file mode 100644 index a6050f891cb91ca212615d66d9ee43fd57d1b1ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4264 zcmb7{2QZv%yT{k+bp??q!7eLeu~z35QC3?ac9rNskZ6n5qOBH$kRYo?^i^WjXo(_lk4#@xwCJax&eds+&e*oBHA|HJu}1#(~( z!{GL1&s=af2zN1>d|h|zn&a^oZ3?d7+n zZlRc^rU2`jXAI)!*`SKKl02LxEb>SyVI#;%9yW`%`|=FA=mT^iBUhUjxBKHjYx+eA z#Hv-TOC||uMuhx0_Zrh4lDD|IM@inQ3;QW9OlJ^i! zPab5YRVYwQli=N>+!V$g-!LSJbn>gJWrZ*ZBpL|PB!xXT$ktgRpk6${ut=h_WVnEKi~O-jvO%^l=u}C7?odeXWwHn|XIN%>K=RIU z(x{)0Y+37W8mKi`Z;kTl^N*WygBg#i=udqVc20mi3a+`6SuMfvdA|UD(%x(i&ghu+ z8?kWRXNmmW#-Nz(@2%wp^f!p|Jq)-s<1)JcBOu# zJ9CT>je`i`0DK=bzd4hy94W;X$OLu^_m-O2?hU9!nclwr%yDdBVB2T)?Zd6(D}jsP ztYPI{@9(@t3kRc&avR(=mTo-`V?Q&Z6(4+_9G?e%)q0l)A={P}bFyHTzLIlT0aeZqtV1@xw%ZuMfrR)qX)oBcy|DIgZi$@*fD)P1azkd6>}0*coLH(Q$Lz z!J@r__9K?)UZilE7Ca)6x5omxQQNmRoT>|HF?Kq($=+a%NzgI0vI_Thzx1^v50o~a zaI3A%tvm;(cn6Zbi(*M??2mI&I0hwF06LTBgpbDzsNlq|*vvRNf0^PIE{x0?Wdc== zROCC8_)Kb1`75Jv5GG&Sd0AW?m8CHl#Td^(G0L|MNpM-YD=}p4x3-%~H84!;{%C|* z)u`sfAT6s-(9ML1L=c)R*T<86AUfM7Y@FyXR$;t?T8|W!^Oh3ON-Et$OM}y@Io>j?sh?*-Cw~zMS~Dp*cuwper6{P{Su9Bi`>eWS znVy=TD%fo#@M8oc9F`ozL7d*9_!>ocICJn6=?t=x!mT`@qQ9CdAC&5r6n8g-X*4tH z3d@V@nOj>KNH>+N)z@W9=@#MFG>f>d%9|h(@=TPMS|1K+UfU9nG?D2J|S) z%{49JipBlgRIbe{yXd4ff=yW3N;-yyDz4G24nwQnRO|}1K@aY<(7tCoA}7BRv`1e# zx4g)8)kRALx*xCl8U)83(^IvfO_mLO_ry=^HS79&<-S~i*5yfyCwOoOqqZBLbm2i< zrVo=FY=z%!{u^@)T`>GeD zE@iMgb`)*hSxn{sPG5O{ht2x zDMeuVuV}3md?NijNMXE)4z6whhY!SjfXW=}iOl-w=r&S}S{69ehi^wwQAkXf6x*hi zUk#=j6(vy7!MvBrTr&#jg~tL-W6OI!Og?mp!Jc<6;2>guqM`QBvAs5g86c8tUG0Z|4Ys=aGIS~}vv ztXkwzN7H+_p5zMPg*f_44TwT4$hqQ!V;m;G~!R6`ar3h3rL5oA&+Jhmh*5+DK=_-;7LtQ$6+E@ z=gfQjqmv(EL@bY|+w@TuVhoelbOMcG&W?4mm&w;2&(F@Txs-hVXo_$B= zqMuRiI|}DvjR|+RM;iuA~`%)ne#i=&A zPw^P~!IgD`v^z4nh@C`d)CgojlD^q2NBl@zl42|bwh@A=v31u&nhyaYSJzfnCz`L- z9dyC=L**g20O)Fqfo6C{$GRP?{CsPt1zM?2(d#G$cs`>QXl1nS;Yx`EE8ql zReUy9x|n;Psk@f#Gw0s-k}-$fBD$?JwSc2hs!TE)O3s^wwH_h-ax71J8?~faj*CmcNpCcl{kv+ zy=d8oH}OD%Dp!>~IfKqd4*$-^QF9;ADOLRfA{l74@`|%ey=a0#m*qiEyne}n z@_1uwFGl<+8EoY}(<{?&!EizW@kQ65N9SJiWvYEnOs~-`06t40 zM1g*i>;HGZ>E$qkdAoDuk3H)%o6h3=S!ns$;cT#8+IIRlH#_g!UY=sNJ$(Y+1OzLi z@hC@J^etO#@gq+>s#wp&$qI!}U^27-6JPKdbymHrlPVM#g zIeEHalQ8BtTE*G$k?p5LdmM2hkj3dmKClLY{5r#K&Wmsp!Y%A0NV zfhnF%wRb#6kTf94z&L+w4Yxc07mJ;M#Bi{C!$|I6zO@K-+3*!qXXSSvv?^+ok+q9n zL+VGHL~boiujS%uh(;R`g3aL`h2IoZc=NJ&Sld)?Y^=CBG(Ou)_`qEA9C?&Flo?=eM zP0Z2UUoHEX1-`(tUIFBj^)P-AzK#hQ%Y=M}D;^)duc=y1V)pq;$1N$S1SY{pQLat!B)q?A6os8oWJu|b@czNHb%tq_wD#QS z43pv+CjS43>EC$bFgiDY2xcX<*5JGT8vI@D4Rby@0#S!gl_SBA>wa(^*q@B5~ z+r3WW)^OLR&c2jSF6O%TcZAv|i$3d3lgUB`Dc@X{zX%h%(X5@IW+=f3> zwGz)=;2lBKSh~}7Q~;!Spyxg4m+#}{1H3%^jPgcbxZkzBEhHe6L6;-?lWI9pq&j{z zwt*so*eq!rshnfkoWOq|iWw5Te10b4mQ#GVt_sv+C`TBaFVTbbz3~=Tnag{h!%I6A zcw>zJBF6fxV-pP>nz&`NmLPv(RoJMhwyoKESHnA+M;Vi_V1^KLN#uoII-)=dlboa~ zbUtPIhHWIZsvKIRXg?4f58(%Gzt@ClXhH_$#@FpyS-}cMGy#5;k2qMf;>X*nG3K@3 z0={GJMa1#1BzYEOOBC)j$-u}lCqI8<0U4iRp{jZM+U*aOU(;mrs2+#+8I8@e_`7)w z>~DMH9KHPDYBs<9WaMd&`+fY|^LIU*5`Gz8Pv5~`LmL54x$UT};bf)lfV0(hiUDfX zn{-~4hSvy5P9ZKwrNI6wB?=)V;T;I5tR%eZV%L>!xT;ZtSz2-`16!O&_aLRP5dbFI zQBL(xeGT>Ot0z55#~tR`PmW?|vu7`~tvYvReKH^$;D4Wn&wc|y2H^X(ojw0^HvW75 zKUKG1S^t&qel}zOW3BtU#6Q)aKN9EY|6kSU@52A&m_NcV8UB;-zy0%f!GD7NM^KOH ckKk{{{|9<~9ZITS$&_br Date: Thu, 16 Nov 2023 13:20:51 -0800 Subject: [PATCH 16/19] Update workflow, finalize release (#20) * Update workflow, finalize release --------- Co-authored-by: Michael Henderson --- .../workflows/keyfactor-starter-workflow.yml | 55 ++++++------------- integration-manifest.json | 3 +- 2 files changed, 18 insertions(+), 40 deletions(-) diff --git a/.github/workflows/keyfactor-starter-workflow.yml b/.github/workflows/keyfactor-starter-workflow.yml index 996751d..6d8de53 100644 --- a/.github/workflows/keyfactor-starter-workflow.yml +++ b/.github/workflows/keyfactor-starter-workflow.yml @@ -1,42 +1,19 @@ -name: Starter Workflow -on: [workflow_dispatch, push, pull_request] +name: Keyfactor Bootstrap Workflow -jobs: - call-create-github-release-workflow: - uses: Keyfactor/actions/.github/workflows/github-release.yml@main - - get-manifest-properties: - runs-on: windows-latest - outputs: - update_catalog: ${{ steps.read-json.outputs.prop }} - steps: - - uses: actions/checkout@v3 - - name: Read json - id: read-json - shell: pwsh - run: | - $json = Get-Content integration-manifest.json | ConvertFrom-Json - echo "::set-output name=prop::$(echo $json.update_catalog)" - - call-dotnet-build-and-release-workflow: - needs: [call-create-github-release-workflow] - uses: Keyfactor/actions/.github/workflows/dotnet-build-and-release.yml@main - with: - release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }} - release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }} - release_dir: HydrantIdProxy/src/HydrantIdProxy/bin/Release # TODO: set build output directory to upload as a release, relative to checkout workspace - secrets: - token: ${{ secrets.PRIVATE_PACKAGE_ACCESS }} +on: + workflow_dispatch: + pull_request: + types: [opened, closed, synchronize, edited, reopened] + push: + create: + branches: + - 'release-*.*' - call-generate-readme-workflow: - if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' - uses: Keyfactor/actions/.github/workflows/generate-readme.yml@main +jobs: + call-starter-workflow: + uses: keyfactor/actions/.github/workflows/starter.yml@v2 secrets: - token: ${{ secrets.APPROVE_README_PUSH }} - - call-update-catalog-workflow: - needs: get-manifest-properties - if: needs.get-manifest-properties.outputs.update_catalog == 'True' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') - uses: Keyfactor/actions/.github/workflows/update-catalog.yml@main - secrets: - token: ${{ secrets.SDK_SYNC_PAT }} + token: ${{ secrets.V2BUILDTOKEN}} + APPROVE_README_PUSH: ${{ secrets.APPROVE_README_PUSH}} + gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }} + gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }} diff --git a/integration-manifest.json b/integration-manifest.json index 61487bf..7699ddc 100644 --- a/integration-manifest.json +++ b/integration-manifest.json @@ -6,6 +6,7 @@ "description": "HydrantId operates a PKI as a service platform for customers around the globe. The AnyGateway solution for HydrantId is designed to allow Keyfactor Command the ability to: - Sync certificates issued from the CA - Request new certificates from the CA - Revoke certificates directly from Keyfactor Command -Renew or Reissue Certificates from the CA", "link_github": true, "update_catalog": true, - "support_level": "kf-supported" + "support_level": "kf-supported", + "release_dir": "HydrantIdProxy/src/HydrantIdProxy/bin/Release" } From d8a4aef3989797911b5c1e134c12c872f78a4e1c Mon Sep 17 00:00:00 2001 From: KFAdmin Date: Mon, 9 Dec 2024 18:22:57 +0000 Subject: [PATCH 17/19] fixed bug with sync --- HydrantIdProxy/src/HydrantIdProxy/Client/HydrantIdClient.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/HydrantIdProxy/src/HydrantIdProxy/Client/HydrantIdClient.cs b/HydrantIdProxy/src/HydrantIdProxy/Client/HydrantIdClient.cs index c3443dc..64d7a97 100644 --- a/HydrantIdProxy/src/HydrantIdProxy/Client/HydrantIdClient.cs +++ b/HydrantIdProxy/src/HydrantIdProxy/Client/HydrantIdClient.cs @@ -344,11 +344,15 @@ public async Task GetSubmitCertificateListRequestAsync(BlockingCollection Date: Mon, 9 Dec 2024 18:24:37 +0000 Subject: [PATCH 18/19] Update generated README --- README.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 70d0912..b244def 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,22 @@ + # HydrantId HydrantId operates a PKI as a service platform for customers around the globe. The AnyGateway solution for HydrantId is designed to allow Keyfactor Command the ability to: - Sync certificates issued from the CA - Request new certificates from the CA - Revoke certificates directly from Keyfactor Command -Renew or Reissue Certificates from the CA #### Integration status: Production - Ready for use in production environments. +## About the Keyfactor AnyCA Gateway DCOM Connector -## About the Keyfactor AnyGateway CA Connector - -This repository contains an AnyGateway CA Connector, which is a plugin to the Keyfactor AnyGateway. AnyGateway CA Connectors allow Keyfactor Command to be used for inventory, issuance, and revocation of certificates from a third-party certificate authority. - +This repository contains an AnyCA Gateway Connector, which is a plugin to the Keyfactor AnyGateway. AnyCA Gateway Connectors allow Keyfactor Command to be used for inventory, issuance, and revocation of certificates from a third-party certificate authority. ## Support for HydrantId -HydrantId is supported by Keyfactor for Keyfactor customers. If you have a support issue, please open a support ticket with your Keyfactor representative. +HydrantId is supported by Keyfactor for Keyfactor customers. If you have a support issue, please open a support ticket via the Keyfactor Support Portal at https://support.keyfactor.com ###### To report a problem or suggest a new feature, use the **[Issues](../../issues)** tab. If you want to contribute actual bug fixes or proposed enhancements, use the **[Pull requests](../../pulls)** tab. +--- + --- @@ -23,6 +24,16 @@ HydrantId is supported by Keyfactor for Keyfactor customers. If you have a suppo +## Keyfactor AnyCA Gateway Framework Supported +The Keyfactor gateway framework implements common logic shared across various gateway implementations and handles communication with Keyfactor Command. The gateway framework hosts gateway implementations or plugins that understand how to communicate with specific CAs. This allows you to integrate your third-party CAs with Keyfactor Command such that they behave in a manner similar to the CAs natively supported by Keyfactor Command. + + + + +This gateway extension was compiled against version of the AnyCA Gateway DCOM Framework. You will need at least this version of the framework Installed. If you have a later AnyGateway Framework Installed you will probably need to add binding redirects in the CAProxyServer.exe.config file to make things work properly. + + +[Keyfactor CAGateway Install Guide](https://software.keyfactor.com/Guides/AnyGateway_Generic/Content/AnyGateway/Introduction.htm) @@ -209,3 +220,4 @@ Set-KeyfactorGatewayConfig -LogicalName "HydrantId" -FilePath [path to json file ### License [Apache](https://apache.org/licenses/LICENSE-2.0) + From c5883d2744f44a36841698527787a15d10be59b5 Mon Sep 17 00:00:00 2001 From: Brian Hill <76450501+bhillkeyfactor@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:28:31 -0500 Subject: [PATCH 19/19] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 631ad69..126ba1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +v1.1.3 +- Fixed sync Issue related to API connectivity to Hydrant ID + v1.1.2 - Recompiled agains the latest gateway and Bouncy Castle Frameworks