Download the PHP package jrglasgow/c2patool without Composer

On this page you can find all versions of the php package jrglasgow/c2patool. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package c2patool

C2PATool

Introduction

This is a PHP wrapper for the c2patool command line binary provided by the Content Authenticity Initiative. The intent is to make it easier to add signed manifests to media assets as well as reading/validating those signed manifests.

Usage

The Tool class

The tool class is the actual wrapper would the c2patool excutable. This Class will pass commands off to the exceutable and return any output.

Creating the Tool

By default the Tool constructor will search the $PATH for the c2patool executable. If it can be found it will be used...if you wish for a different version of the utility to be used you can specify

The Signer class

The Signer class will handle all things certificate and will sign the media asset manifests.

Validating the cert can be used for Content Authenticity

You can validate that the certificate can be used for Content Credential signing by passing the certificate/key locations into the Signer::validateCert() method. If you pass in a stdClass object information about the certificate will be placed in the object for later use. Certificate MUST follow the specification in the Content Authenticity Initiative documentation for Signing Manifests.

If $cert_file_path = 'ENVIRONMENT_VARIABLE'; and $key_file_path = ''ENVIRONMENT_VARIABLE'; then instead of looking for the key and cert files on the file shystem the environment variables C2PA_PRIVATE_KEY and C2PA_SIGN_CERT variables will be used instead as allowed in the c2patool documentation.

Creating a new Signer

As with certificate validation if $cert_file_path = 'ENVIRONMENT_VARIABLE'; and $key_file_path = ''ENVIRONMENT_VARIABLE'; then instead of looking for the key and cert files on the file shystem the environment variables C2PA_PRIVATE_KEY and C2PA_SIGN_CERT variables will be used instead as allowed in the c2patool documentation.

Signing and embedding a manifest

Creating a Manifest

Create your manifest as a JSON string or an Array using the examples as a reference. The manifest will be modified and converted to a string afterwards.. The signature algorithm (alg), Private Key (private_key) and Sign Certificate (sign_cert) need not be included as they will be replaced with the information from the certificate when creating the Signer object. If the Claim Generator (claim_generator) is left empty one will be inserted automatically. Likewise if the Time Authority (ta_url) is left empty one will be inserted as well.

Invoke the sign method


All versions of c2patool with dependencies

PHP Build Version
Package Version
Requires symfony/process Version ^6.0 || ^7.0
psr/log Version ^3.0
phpseclib/phpseclib Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jrglasgow/c2patool contains the following files

Loading the files please wait ...