Skip to content

Commit

Permalink
ab#66269
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Fine committed Dec 18, 2024
1 parent 53499df commit c6ea736
Show file tree
Hide file tree
Showing 7 changed files with 250 additions and 0 deletions.
67 changes: 67 additions & 0 deletions Fortigate/Api/Certificate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//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 the specific language governing permissions and
//limitations under the License.

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace Keyfactor.Extensions.Orchestrator.Fortigate.Api
{
public class Certificate
{
public string name { get; set; }
public string source { get; set; }
public string comments { get; set; }
public bool exists { get; set; }
public string range { get; set; }
public bool is_ssl_server_cert { get; set; }
public bool is_ssl_client_cert { get; set; }
public bool is_proxy_ssl_cert { get; set; }
public bool is_general_allowable_cert { get; set; }
public bool is_default_local { get; set; }
public bool is_built_in { get; set; }
public bool is_wifi_cert { get; set; }
public bool is_deep_inspection_cert { get; set; }
public bool has_valid_cert_key { get; set; }
public string key_type { get; set; }
public int key_size { get; set; }
public bool is_local_ca_cert { get; set; }
public string type { get; set; }
public string status { get; set; }
public long valid_from { get; set; }
public string valid_from_raw { get; set; }
public long valid_to { get; set; }
public string valid_to_raw { get; set; }
public string signature_algorithm { get; set; }
public Subject subject { get; set; }
public string subject_raw { get; set; }
public Issuer issuer { get; set; }
public string issuer_raw { get; set; }
public string fingerprint { get; set; }
public int version { get; set; }
public bool is_ca { get; set; }
public string serial_number { get; set; }
public Ext[] ext { get; set; }
public string q_path { get; set; }
public string q_name { get; set; }
public int q_ref { get; set; }
public bool q_static { get; set; }
public int q_type { get; set; }
}

[JsonConverter(typeof(StringEnumConverter))]
public enum KeyType
{
RSA, DSA, ECDSA
}
}

22 changes: 22 additions & 0 deletions Fortigate/Api/Ext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//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 the specific language governing permissions and
//limitations under the License.

namespace Keyfactor.Extensions.Orchestrator.Fortigate.Api
{
public class Ext
{
public string name { get; set; }
public string data { get; set; }
public bool critical { get; set; }
}
}
29 changes: 29 additions & 0 deletions Fortigate/Api/FortigateResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//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 the specific language governing permissions and
//limitations under the License.

namespace Keyfactor.Extensions.Orchestrator.Fortigate.Api
{
public class FortigateResponse<ResultType>
{
public string http_method { get; set; }
public ResultType results { get; set; }
public string vdom { get; set; }
public string path { get; set; }
public string name { get; set; }
public string action { get; set; }
public string status { get; set; }
public string serial { get; set; }
public string version { get; set; }
public int build { get; set; }
}
}
26 changes: 26 additions & 0 deletions Fortigate/Api/Issuer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//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 the specific language governing permissions and
//limitations under the License.

namespace Keyfactor.Extensions.Orchestrator.Fortigate.Api
{
public class Issuer
{
public string C { get; set; }
public string ST { get; set; }
public string L { get; set; }
public string O { get; set; }
public string OU { get; set; }
public string CN { get; set; }
public string emailAddress { get; set; }
}
}
26 changes: 26 additions & 0 deletions Fortigate/Api/Subject.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//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 the specific language governing permissions and
//limitations under the License.

namespace Keyfactor.Extensions.Orchestrator.Fortigate.Api
{
public class Subject
{
public string C { get; set; }
public string ST { get; set; }
public string L { get; set; }
public string O { get; set; }
public string OU { get; set; }
public string CN { get; set; }
public string emailAddress { get; set; }
}
}
47 changes: 47 additions & 0 deletions Fortigate/Api/Usage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//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 the specific language governing permissions and
//limitations under the License.

using System.Text.Json.Serialization;

namespace Keyfactor.Extensions.Orchestrator.Fortigate.Api
{
public class Usage
{
public CanUse[] can_use { get; set; }

public CurrentlyUsing[] currently_using { get; set; }

public int[] q_types { get; set; }

public class CanUse
{
public string name { get; set; }
public string path { get; set; }
public string range { get; set; }
}

public class CurrentlyUsing
{
public string attribute { get; set; }
public string name { get; set; }
public string path { get; set; }
public string range { get; set; }
public int reference_count { get; set; }
public bool static_ { get; set; }
[JsonPropertyName("static")]
public string table_type { get; set; }
public string vdom { get; set; }
}
//[attribute, mkey, name, path, range, reference_count,static,table_type,vdom]
}
}
33 changes: 33 additions & 0 deletions Fortigate/Api/cmdb_certificate_resource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//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 the specific language governing permissions and
//limitations under the License.

namespace Keyfactor.Extensions.Orchestrator.Fortigate.Api
{
public class cmdb_certificate_resource
{
public string type { get; set; }

public string certname { get; set; }

//< pass phrase used to encrypt key>
//public string password { get; set; }

//<base64-encoded certificate, without line breaks>
public string key_file_content { get; set; }

//<base64-encoded certificate, without line breaks>
public string file_content { get; set; }

public string scope { get; set; }
}
}

0 comments on commit c6ea736

Please sign in to comment.