{"id":22559696,"url":"https://github.com/random-guys/coralpay-pgp","last_synced_at":"2025-03-28T12:12:11.881Z","repository":{"id":39895713,"uuid":"219198507","full_name":"random-guys/coralpay-pgp","owner":"random-guys","description":"Typescript library for encrypting and decrypting requests and responses for CoralPay's CGate","archived":false,"fork":false,"pushed_at":"2023-01-04T23:59:01.000Z","size":378,"stargazers_count":1,"open_issues_count":14,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T12:35:51.570Z","etag":null,"topics":["coralpay-pgp","lib","library","openpgp","pgp"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/random-guys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-02T18:46:25.000Z","updated_at":"2021-01-14T17:21:30.000Z","dependencies_parsed_at":"2023-02-03T01:01:25.565Z","dependency_job_id":null,"html_url":"https://github.com/random-guys/coralpay-pgp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/random-guys%2Fcoralpay-pgp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/random-guys%2Fcoralpay-pgp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/random-guys%2Fcoralpay-pgp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/random-guys%2Fcoralpay-pgp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/random-guys","download_url":"https://codeload.github.com/random-guys/coralpay-pgp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246026110,"owners_count":20711581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["coralpay-pgp","lib","library","openpgp","pgp"],"created_at":"2024-12-07T21:08:00.677Z","updated_at":"2025-03-28T12:12:11.859Z","avatar_url":"https://github.com/random-guys.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CoralPay PGP 🔐\n\nCoralPay Encryption and Decryption Lib which is a [wrapper](https://github.com/drudge/node-gpg) around the GPG cli tool.\n\n# Installation\n\n```sh\nyarn add @random-guys/coralpay-pgp\n```\n\nor\n\n```sh\nnpm install @random-guys/coralpay-pgp\n```\n\n## Usage\n\n```ts\nimport { Pgp } from '@random-guys/coralpay-pgp';\n\ntry {\n  const publicKeyPath = join(__dirname, './keys/public_key.txt');\n  const privateKeyPath = join(__dirname, './keys/private_key.txt');\n  const passphrase = 'c-ronaldo';\n\n  const pgp = new Pgp({\n    privateKeyPath,\n    publicKeyPath,\n    passphrase\n  });\n\n  const payload = {\n    accountNumber: '00000111111'\n    name: 'Raymond',\n    age: '20',\n  };\n\n  const encrypted = await utilities.encryptRequest(payload);\n  const decrypted = await pgp.decryptResponse(encrypted);\n  console.log({ encrypted, decrypted });\n} catch (error) {\n  console.log(error);\n}\n```\n\n## Usage with Docker\n\n### Prerequisites\n\n1. Modify `run.sh` to change the paths to your keys. This imports the keys into your gpg keychain in the container.\n\n2. Create a passphrase (called my `passphrase.txt`) file. Practically this may be an envionment variable on your CI that's written to the file, knock yourself out.\n\n## Issues\n\n### Testing\n\nIf you have any issues when trying to run unit tests, where the error message is `concatUint8Array: Data must be in the form of a Uint8Array`, see this [github issue](https://github.com/openpgpjs/openpgpjs/issues/821)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandom-guys%2Fcoralpay-pgp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frandom-guys%2Fcoralpay-pgp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandom-guys%2Fcoralpay-pgp/lists"}