{"id":22819603,"url":"https://github.com/netreconlab/parsecertificateauthority","last_synced_at":"2026-01-27T06:02:16.452Z","repository":{"id":65536840,"uuid":"594152267","full_name":"netreconlab/ParseCertificateAuthority","owner":"netreconlab","description":"Send CSR's and retreive certificates to/from ca-server's from your own Swift based client and server apps.","archived":false,"fork":false,"pushed_at":"2026-01-18T05:51:03.000Z","size":3362,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-18T15:53:49.291Z","etag":null,"topics":["certificate-authority","certificate-signing-request","csr","hacktoberfest","parse-cloud-code","parse-server","server-side-swift","swift"],"latest_commit_sha":null,"homepage":"https://swiftpackageindex.com/netreconlab/ParseCertificateAuthority/main/documentation/parsecertificateauthority","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/netreconlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["cbaker6","netreconlab"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://www.buymeacoffee.com/cbaker6"}},"created_at":"2023-01-27T18:12:57.000Z","updated_at":"2026-01-18T05:48:30.000Z","dependencies_parsed_at":"2025-04-23T00:37:29.746Z","dependency_job_id":null,"html_url":"https://github.com/netreconlab/ParseCertificateAuthority","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"2df040627c0bf1ac45b2a685596fed459f901bf3"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/netreconlab/ParseCertificateAuthority","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netreconlab%2FParseCertificateAuthority","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netreconlab%2FParseCertificateAuthority/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netreconlab%2FParseCertificateAuthority/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netreconlab%2FParseCertificateAuthority/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netreconlab","download_url":"https://codeload.github.com/netreconlab/ParseCertificateAuthority/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netreconlab%2FParseCertificateAuthority/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28805337,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T05:43:52.625Z","status":"ssl_error","status_checked_at":"2026-01-27T05:43:48.957Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["certificate-authority","certificate-signing-request","csr","hacktoberfest","parse-cloud-code","parse-server","server-side-swift","swift"],"created_at":"2024-12-12T15:13:15.924Z","updated_at":"2026-01-27T06:02:16.447Z","avatar_url":"https://github.com/netreconlab.png","language":"Swift","funding_links":["https://github.com/sponsors/cbaker6","https://github.com/sponsors/netreconlab","https://www.buymeacoffee.com/cbaker6"],"categories":[],"sub_categories":[],"readme":"# ParseCertificateAuthority\n\n[![Documentation](http://img.shields.io/badge/read-docs-2196f3.svg)](https://swiftpackageindex.com/netreconlab/ParseCertificateAuthority/documentation)\n[![Tuturiol](http://img.shields.io/badge/read-tuturials-2196f3.svg)](https://netreconlab.github.io/ParseCertificateAuthority/release/tutorials/parsecertificateauthority/)\n[![ci](https://github.com/netreconlab/ParseCertificateAuthority/actions/workflows/ci.yml/badge.svg)](https://github.com/netreconlab/ParseCertificateAuthority/actions/workflows/ci.yml)\n[![release](https://github.com/netreconlab/ParseCertificateAuthority/actions/workflows/release.yml/badge.svg)](https://github.com/netreconlab/ParseCertificateAuthority/actions/workflows/release.yml)\n[![codecov](https://codecov.io/gh/netreconlab/ParseCertificateAuthority/branch/main/graph/badge.svg?token=RC3FLU6BGW)](https://codecov.io/gh/netreconlab/ParseCertificateAuthority)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/netreconlab/ParseCertificateAuthority/blob/main/LICENSE)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fnetreconlab%2FParseCertificateAuthority%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/netreconlab/ParseCertificateAuthority)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fnetreconlab%2FParseCertificateAuthority%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/netreconlab/ParseCertificateAuthority)\n\n---\n\nSend CSR's and retreive certificates to/from `ca-server`'s from your own Swift based client and server apps. `Certificatable` allows any object to support certificates while `ParseCertificatable` allows any [ParseObject](https://netreconlab.github.io/Parse-Swift/release/documentation/parseswift/parseobject) from [Parse-Swift](https://github.com/netreconlab/Parse-Swift). `ParseCertificateAuthority` helps developers add an extra layer of security to their apps by making it easy to enable certificate pinning, authentication/verification, encrypting/decrypting, and secure device-to-device offline communication with key/certificate exchange.\n\n## `ParseCertificateAuthority` is Designed to Work With `ca-server`\n- [ca-server](https://github.com/netreconlab/ParseCertificateAuthority) - A certificate authority(CA) that can turn CSR's into certificates\n- [CertificateSigningRequest](https://github.com/cbaker6/CertificateSigningRequest) - Generate CSR's on Swift clients and servers that can later be signed by `ca-server`\n- [Parse-Swift](https://github.com/netreconlab/Parse-Swift) - Write Parse client apps in Swift. When coupled with [ParseCertificateAuthority](https://github.com/netreconlab/ParseCertificateAuthority) and [CertificateSigningRequest](https://github.com/cbaker6/CertificateSigningRequest), provides the complete client-side stack for generating CSR's, sending/receiving certificates to/from `ca-server`\n- [ParseServerSwift](https://github.com/netreconlab/parse-server-swift) - Write Parse Server Cloud Code apps in Swift. When coupled with [ParseCertificateAuthority](https://github.com/netreconlab/ParseCertificateAuthority), [CertificateSigningRequest](https://github.com/cbaker6/CertificateSigningRequest), and [Parse-Swift](https://github.com/netreconlab/Parse-Swift) provides the complete server-side stack for generating CSR's, sending/receiving certificates to/from `ca-server`\n\n## Adding `ParseCertificateAuthority` to Your App\nSetup a Vapor project by following the [directions](https://www.kodeco.com/11555468-getting-started-with-server-side-swift-with-vapor-4) for installing and setting up your project on macOS or linux.\n\nIn your `Package.swift` file add `ParseCertificateAuthority` to `dependencies`:\n\n```swift\n// swift-tools-version:5.5.2\nimport PackageDescription\n\nlet package = Package(\n    name: \"YOUR_PROJECT_NAME\",\n    dependencies: [\n        .package(url: \"https://github.com/netreconlab/ParseCertificateAuthority\", .upToNextMajor(from: \"0.1.0\")),\n    ]\n)\n```\n\n## Configure `ParseCertificateAuthority`\n```swift\nimport ParseCertificateAuthority\n\n// Innitialize ParseCertificateAuthority\nlet caConfiguration = try ParseCertificateAuthorityConfiguration(caURLString: \"http://certificate-authority:3000\", // The url for `ca-server`.\n                                                                 caRootCertificatePath: \"/ca_certificate\", // The root certificate path on `ca-server`.\n                                                                 caCertificatesPath: \"/certificates/\", // The certificates path on `ca-server`.\n                                                                 caUsersPath: \"/appusers/\") // The user path on `ca-server`.\ninitialize(configuration: caConfiguration)\n```\n\n## Choosing an `Object` or `ParseObject` Model to Conform to `Certificatable` or `ParseCertificatable`\nBelow is an example of conforming to `ParseCertificatable` if you are using `Parse-Swift`. If you are not using `Parse-Swift`, the process is similar except you conform to `Certificatable` and use the relevant methods. At least one of your `ParseObject` models need to conform to `ParseCertificatable`. A good candidate is a model that already conforms to `ParseInstallatiion` as this is unique per installation on each device.\n\n```swift\n// Conform to `ParseCertificatable`. If not using Parse-Swift, conform to `Certificatable` instead.\nstruct Installation: ParseInstallation, ParseCertificatable {\n    var rootCertificate: String?\n\n    var certificate: String?\n\n    var csr: String?\n    \n    var certificateId: String? {\n        installationId\n    }\n    ...\n}\n```\n\n## Creating a New Certificate From a CSR\nOnce you have a CSR from a package like [CertificateSigningRequest](https://github.com/cbaker6/CertificateSigningRequest), you can create an account for the current `ParseUser` automatically and send the CSR to a [ca-server](https://github.com/netreconlab/ParseCertificateAuthority) by doing the following:\n\n```swift\ndo {\n    let user = User.current // Some user type that conforms to `ParseUser`.\n    var installation = Installation.current\n    let (certificate, rootCertificate) = try await installation.getCertificates(user)\n    if installation.certificate != certificate || installation.rootCertificate != rootCertificate {\n        installation.certificate = certificate\n        installation.rootCertificate = rootCertificate\n        try await installation.save()\n        \n        // Notify the user their object has been updated with the certificates\n    }\n} catch {\n    // Handle error\n}\n```\n\n## Requesting a New Certificate Be Generated for an Existing CSR\nCreating a new certificate for a CSR can be useful when a certificate has expired. To generage a new certificate, do the following:\n\n```swift\ndo {\n    let user = User.current // Some user type that conforms to `ParseUser`.\n    var installation = Installation.current\n    let (certificate, rootCertificate) = try await installation.requestNewCertificates(user)\n    guard let certificate = certificate,\n          let rootCertificate = rootCertificate else {\n        let error = ParseError(code: .otherCause,\n                               message: \"Could not get new certificates\")\n        return\n    }\n    \n    installation.certificate = certificate\n    installation.rootCertificate = rootCertificate\n    try await installation.save()\n       \n    // Notify the user their object has been updated with the certificates\n} catch {\n    // Handle error\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetreconlab%2Fparsecertificateauthority","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetreconlab%2Fparsecertificateauthority","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetreconlab%2Fparsecertificateauthority/lists"}