{"id":15405268,"url":"https://github.com/fnando/csr","last_synced_at":"2025-04-17T00:51:58.099Z","repository":{"id":29724728,"uuid":"33267928","full_name":"fnando/csr","owner":"fnando","description":"Generate CSR (Certificate Signing Request) using Ruby and OpenSSL.","archived":false,"fork":false,"pushed_at":"2020-09-24T07:05:23.000Z","size":26,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T05:51:15.519Z","etag":null,"topics":["certificate-signing-request","csr","openssl","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/fnando.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["fnando"],"custom":["https://www.paypal.me/nandovieira/🍕"]}},"created_at":"2015-04-01T19:26:53.000Z","updated_at":"2021-01-15T07:56:59.000Z","dependencies_parsed_at":"2022-08-27T16:20:59.067Z","dependency_job_id":null,"html_url":"https://github.com/fnando/csr","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnando%2Fcsr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnando%2Fcsr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnando%2Fcsr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnando%2Fcsr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fnando","download_url":"https://codeload.github.com/fnando/csr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249294930,"owners_count":21246011,"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":["certificate-signing-request","csr","openssl","ruby"],"created_at":"2024-10-01T16:15:47.860Z","updated_at":"2025-04-17T00:51:58.079Z","avatar_url":"https://github.com/fnando.png","language":"Ruby","readme":"# CSR\n\n[![Travis-CI](https://travis-ci.org/fnando/csr.svg)](https://travis-ci.org/fnando/csr)\n[![Code Climate](https://codeclimate.com/github/fnando/csr/badges/gpa.svg)](https://codeclimate.com/github/fnando/csr)\n[![Test Coverage](https://codeclimate.com/github/fnando/csr/badges/coverage.svg)](https://codeclimate.com/github/fnando/csr/coverage)\n[![Gem](https://img.shields.io/gem/v/csr.svg)](https://rubygems.org/gems/csr)\n[![Gem](https://img.shields.io/gem/dt/csr.svg)](https://rubygems.org/gems/csr)\n\nGenerate CSR (Certificate Signing Request) using Ruby and OpenSSL.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"csr\"\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install csr\n\n## Usage\n\n```ruby\nrequire \"csr\"\n\ncsr = CSR.new(\n  country: \"US\",\n  state: \"CA\",\n  city: \"San Francisco\",\n  department: \"Web\",\n  organization: \"Example Inc.\",\n  common_name: \"example.com\",\n  email: \"john@example.com\"\n)\n\ncsr.pem\ncsr.private_key_pem\ncsr.save_to \"/tmp\", \"server\"\n#=\u003e creates /tmp/server.csr and /tmp/server.key\n```\n\nTo use a passphrase on your private key, do it like this:\n\n```ruby\ncsr = CSR.new(\n  country: \"US\",\n  state: \"CA\",\n  city: \"San Francisco\",\n  department: \"Web\",\n  organization: \"Example Inc.\",\n  common_name: \"example.com\",\n  email: \"john@example.com\",\n  passphrase: \"sekret\"\n)\n```\n\nYou can also verifiy CSR.\n\n```ruby\n# If you did not use a passphrase on your private key\nCSR.verify?(csr_content, pk_content)\n\n# If you did use a passphrase on your private key\nCSR.verify?(csr_content, pk_content, passphrase)\n```\n\nTo load a CSR back:\n\n```ruby\ncsr = CSR.load(\n  File.read(\"/tmp/server.csr\"),\n  passphrase: \"sekret\",\n  private_key: File.read(\"/tmp/server.key\")\n)\n\ncsr.common_name = \"example.com\"\n```\n\nNotice that `private_key` and `passphrase` are optional when loading CSR; it's\njust a shortcut in case you want to regenerate CSR.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run\n`bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To\nrelease a new version, update the version number in `version.rb`, and then run\n`bundle exec rake release` to create a git tag for the version, push git commits\nand tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\n1. Fork it ( https://github.com/fnando/csr/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","funding_links":["https://github.com/sponsors/fnando","https://www.paypal.me/nandovieira/🍕"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnando%2Fcsr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffnando%2Fcsr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnando%2Fcsr/lists"}