{"id":15609237,"url":"https://github.com/tomascco/rubrik","last_synced_at":"2025-08-11T22:39:36.335Z","repository":{"id":119979591,"uuid":"538259014","full_name":"tomascco/rubrik","owner":"tomascco","description":"Sign PDFs with PAdES standard, using EU and Brazil's signature profiles.","archived":false,"fork":false,"pushed_at":"2023-12-01T20:21:37.000Z","size":930,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-28T12:03:45.718Z","etag":null,"topics":["cades","pades","pdf","pdf-signing","ruby"],"latest_commit_sha":null,"homepage":"https://github.com/tomascco/rubrik","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/tomascco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2022-09-18T22:36:19.000Z","updated_at":"2024-10-21T00:35:51.000Z","dependencies_parsed_at":"2024-10-22T16:30:15.128Z","dependency_job_id":null,"html_url":"https://github.com/tomascco/rubrik","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomascco%2Frubrik","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomascco%2Frubrik/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomascco%2Frubrik/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomascco%2Frubrik/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomascco","download_url":"https://codeload.github.com/tomascco/rubrik/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251311333,"owners_count":21569009,"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":["cades","pades","pdf","pdf-signing","ruby"],"created_at":"2024-10-03T05:41:43.677Z","updated_at":"2025-04-28T12:03:52.913Z","avatar_url":"https://github.com/tomascco.png","language":"Ruby","readme":"# Rubrik\n\nRubrik is a complete and simple digital signature library that implements the PAdES standard (PDF Advanced Electronic\nSignatures) in pure Ruby. It conforms with PKCS#7 and **will be** compatible with Brazil's AD-RB, AD-RT and EU's B-B\nand B-T profiles.\n\n- [Rubrik](#rubrik)\n  - [Implementation Status](#implementation-status)\n    - [PDF Features](#pdf-features)\n    - [Signature Profiles](#signature-profiles)\n  - [Installation](#installation)\n  - [Usage](#usage)\n  - [Development](#development)\n  - [References:](#references)\n  - [Contributing](#contributing)\n  - [License](#license)\n  - [Code of Conduct](#code-of-conduct)\n\n## Implementation Status\n\nThis gem is under development and may be subjected to breaking changes.\n\n### PDF Features\n- [x] Modify PDFs with incremental updates (doesn't modify the documents, only append signature appearance)\n- [ ] Encryption Support\n- [ ] Signature appearance (stamp)\n- [ ] External (offline) signatures\n\n### Signature Profiles\n- [x] CMS (PKCS#7)\n- [ ] PAdES B-B (conforms with PAdES-E-BES)\n- [ ] PAdES B-T (conforms with PAdES-E-BES)\n- [ ] PAdES AD-RB\n- [ ] PAdES AD-RT\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add rubrik\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install rubrik\n\n## Usage\n\nWith the gem loaded, run the following to sign an document:\n\n```ruby\n# The input and output can be of types `File`, `Tempfile` or `StringIO`.\ninput_pdf = File.open(\"example.pdf\", \"rb\")\noutput_pdf = File.open(\"signed_example.pdf\", \"wb+\") # needs read permission\n\n# Load Certificate(s)\ncertificate_file = File.open(\"example_cert.pem\", \"rb\")\nprivate_key = OpenSSL::PKey::RSA.new(certificate_file, \"\")\ncertificate_file.rewind\ncertificate = OpenSSL::X509::Certificate.new(certificate_file)\ncertificate_file.close\n\n# Will write the signed document to `output_pdf`\nRubrik::Sign.call(input_pdf, output_pdf, private_key:, certificate:, certificate_chain: [])\n\n# Don't forget to close the files\ninput_pdf.close\noutput_pdf.close\n```\nMultiple signatures on a single document can be achieved by calling `Rubrik::Sign` repeatedly using the last signature\noutput as input for the next signature. A better API for this use case may be developed.\n\n\n## Development\n\nAfter checking out the repo, run `bundle install` to install dependencies. Then, run `rake test` to run the tests. You can also run `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 release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## References:\n1. PDF References:\n    - [ISO 3200-2](https://pdfa.org/sponsored-standards/)\n\n2. Brazil's technical references:\n    - [DOC-ICP-15.03](https://www.gov.br/iti/pt-br/assuntos/legislacao/instrucoes-normativas/IN032021_DOC_15.03_assinada.pdf)\n3. EU's technical references:\n    - [ETSI 319 122-1](https://www.etsi.org/deliver/etsi_en/319100_319199/31912201/01.02.01_60/en_31912201v010201p.pdf)\n    - [ETSI 319 122-2](https://www.etsi.org/deliver/etsi_en/319100_319199/31912201/01.02.01_60/en_31912201v010201p.pdf)\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/tomascco/rubrik. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/tomascco/rubrik/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the rubrik project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/tomascco/rubrik/blob/main/CODE_OF_CONDUCT.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomascco%2Frubrik","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomascco%2Frubrik","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomascco%2Frubrik/lists"}