{"id":18521746,"url":"https://github.com/transferwise/digital-signatures","last_synced_at":"2025-04-23T00:07:04.914Z","repository":{"id":55532657,"uuid":"231388134","full_name":"transferwise/digital-signatures","owner":"transferwise","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-15T14:01:46.000Z","size":70,"stargazers_count":3,"open_issues_count":8,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-23T00:06:53.301Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/transferwise.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}},"created_at":"2020-01-02T13:31:55.000Z","updated_at":"2025-03-20T10:17:51.000Z","dependencies_parsed_at":"2024-11-06T17:45:12.657Z","dependency_job_id":null,"html_url":"https://github.com/transferwise/digital-signatures","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/transferwise%2Fdigital-signatures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transferwise%2Fdigital-signatures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transferwise%2Fdigital-signatures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transferwise%2Fdigital-signatures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transferwise","download_url":"https://codeload.github.com/transferwise/digital-signatures/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250343935,"owners_count":21415038,"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-06T17:27:20.784Z","updated_at":"2025-04-23T00:07:04.895Z","avatar_url":"https://github.com/transferwise.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Library for signing data with private key\n\nProvides functionality for creating RSA digital signatures.\n\n## Requirements\n\n* Java \u0026ge; 8\n\n## Generating a RSA private/public key pair\n\nTo generate a RSA key pair and store it in PEM format you can use the OpenSSL cryptography and SSL/TLS toolkit:\n\n1. Install OpenSSL following the instructions from [its official website](https://www.openssl.org/).\n2. Generate private RSA key (key length \u0026ge; 2048 is required for sufficient cryptographic complexity):\n    ```bash\n    $ openssl genrsa -out private.pem 2048\n    ```\n3. Generate public RSA key from private key:\n    ```bash\n    $ openssl rsa -pubout -in private.pem -out public.pem\n    ```\n\n## [Library](./digital-signatures)\n\nContains a single utility class \n[DigitalSignatures](./digital-signatures/src/main/java/com/transferwise/digitalsignatures/DigitalSignatures.java) \nwith straightforward usage:\n```java\nbyte[] signature = DigitalSignatures.sign(Path privateKeyFilePath, byte[] dataToSign);\n```\nThere are also options to provide the private key as `String` or `Reader`.\nThe resulting signature byte array can be encoded to [Base64](https://en.wikipedia.org/wiki/Base64) in case it is \ngoing to be transferred over HTTP. For such cases there is a convenience method:\n```java\nString signatureBase64 = DigitalSignatires.encodeToBase64(byte[] bytes);\n```\n\n## [CLI tool](./digital-signatures-cli)\n\nTo allow users to sign their data via CLI there is an executable JAR:\n```bash\nusage: java -jar digital-signatures-cli-\u003cversion\u003e-all.jar -d \u003cDATA\u003e -k \u003cPATH\u003e\nCalculates SHA256 with RSA signature in Base64 encoding for provided data\n -d,--data-to-sign \u003cDATA\u003e       String containing data to sign\n -k,--private-key-file \u003cPATH\u003e   Path to file containing RSA private key\n```\n\n## Building\n\nRun `./gradlew clean build`. \n\nThe CLI tool executable JAR is assembled to an extra `*-all.jar` artifact of `digital-signatures-cli` module.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransferwise%2Fdigital-signatures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftransferwise%2Fdigital-signatures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransferwise%2Fdigital-signatures/lists"}