Coder Social home page Coder Social logo

laravel-pdf-signer's Introduction

Logo

PDF Signer by DevRaeph

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads


With this packages you can digitally sign pdf files with a certificate.

Installation

You can install the package via composer:

composer require devraeph/laravel-pdf-signer

You can publish the config file with:

php artisan vendor:publish --provider="DevRaeph\PdfSigner\PdfSignerServiceProvider" --tag="pdf-signer-config"

This is the contents of the published config file:

return [
    "business"      =>      "",
    "reason"        =>      "",
    "url"           =>      "",
    "cert"          =>      env("SIGNER_CERT_PATH","cert/test.crt"),
    "key"           =>      env("SIGNER_KEY_PATH","cert/key.key"),
    "password"      =>      env("SIGNER_KEY_PASSWORD","")
];

Create self signed Certificate

Generate Key file withour password:

openssl genrsa -out example.key 4096

Generate Key file with password set:

openssl genrsa -aes128 -passout pass:MyStrongPwd -out example.key 4096

Generate self signed Certificate:

openssl openssl req -x509 -nodes -days 365000 -key example.key -out example.crt

Environment Variables

Following vars have to be set in .env file:

SIGNER_CERT_PATH Storage path of created certificate

SIGNER_KEY_PATH Storage path of created key file

SIGNER_KEY_PASSWORD optional password for key file

Usage

Only use Facade to interact with the PDF Signer.

use DevRaeph\PdfSigner\Facades\PdfSigner;

/* Load file from Storage path */

PDFSigner::loadFile("example.pdf")
        ->setSavePath() //Optional save Path
        ->sign();

Credits

Sponsor

ko-fi

License

The MIT License (MIT). Please see License File for more information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.