{"id":20244277,"url":"https://github.com/protonmail/x509-sign","last_synced_at":"2025-04-10T20:45:21.064Z","repository":{"id":49074005,"uuid":"327948244","full_name":"ProtonMail/x509-sign","owner":"ProtonMail","description":"Simple endpoint to sign ASN1 strings","archived":false,"fork":false,"pushed_at":"2021-06-29T13:22:58.000Z","size":194,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T18:21:12.494Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ProtonMail.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}},"created_at":"2021-01-08T16:01:26.000Z","updated_at":"2023-11-20T21:38:08.000Z","dependencies_parsed_at":"2022-09-07T20:22:57.154Z","dependency_job_id":null,"html_url":"https://github.com/ProtonMail/x509-sign","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProtonMail%2Fx509-sign","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProtonMail%2Fx509-sign/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProtonMail%2Fx509-sign/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProtonMail%2Fx509-sign/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProtonMail","download_url":"https://codeload.github.com/ProtonMail/x509-sign/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248294729,"owners_count":21079957,"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":[],"created_at":"2024-11-14T09:14:00.298Z","updated_at":"2025-04-10T20:45:21.033Z","avatar_url":"https://github.com/ProtonMail.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# X509 Sign\n\nA simple endpoint to sign X509 certificates.\n\n# Usage\n\n### Via HTTP:\n\nExpose `index.php` on a webserver.\n\nGet the signature server public key:\n```\nPOST /\n```\n```json\n{\n  \"publicKey\": {}\n}\n```\n\nOr specify a format:\n```\nPOST /\n```\n```json\n{\n  \"publicKey\": {\"format\": \"PSS\"}\n}\n```\n\nRequest a signature:\n```\nPOST /\n```\n```json\n{\n  \"signedCertificate\": {\n    \"certificate\": \"-----BEGIN...\",\n    \"clientPublicKey\": \"-----BEGIN...\"\n  }\n}\n```\n\nYou can group requests and get both results aggregated:\n\n```\nPOST /\n```\n```json\n{\n  \"publicKey\": {},\n  \"signedCertificate\": {\n    \"certificate\": \"-----BEGIN...\",\n    \"clientPublicKey\": \"-----BEGIN...\"\n  }\n}\n```\n\nWould result the following JSON output:\n\n```json\n{\n  \"publicKey\": {\n    \"success\": true,\n    \"result\": \"-----BEGIN...\"\n  },\n  \"signedCertificate\": {\n    \"success\": true,\n    \"result\": \"-----BEGIN...\"\n  }\n}\n```\n\nWith the server signature public key string and the signed certificate.\n\n### As a service\n\nUse `Issuer::issue()` to sign certificates from a PHP application.\n\n```php\nuse Proton\\X509Sign\\Issuer;\nuse phpseclib3\\Crypt\\RSA\\PrivateKey;\nuse phpseclib3\\Crypt\\RSA\\PublicKey;\n\n$issuer = new Issuer();\n$issuer-\u003eissue(\n    PrivateKey::load('-----BEGIN...'),\n    PublicKey::load('-----BEGIN...'),\n    ['commonName' =\u003e 'foo'],\n    ['commonName' =\u003e 'bar'],\n    '9256',\n);\n```\n\n## Config\n\nDefine environment variables to configure your server:\n\n- `SIGNATURE_PRIVATE_KEY` PKCS1 string of the private signature key.\n\n- `SIGNATURE_PRIVATE_KEY_PASSPHRASE` Passphrase/password of the private key.\n\n- `EXTENSIONS` JSON representation of X509 extensions to support.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotonmail%2Fx509-sign","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprotonmail%2Fx509-sign","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotonmail%2Fx509-sign/lists"}