Download the PHP package setasign/cloud-kms-csr without Composer
On this page you can find all versions of the php package setasign/cloud-kms-csr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download setasign/cloud-kms-csr
More information about setasign/cloud-kms-csr
Files in setasign/cloud-kms-csr
Package cloud-kms-csr
Short Description Tools to create and update certificate signing requests (CSRs) and self-signed certificates with keys from cloud key management systems (AWS KMS and Google Cloud KMS)
License MIT
Homepage https://github.com/Setasign/Cloud-KMS-CSR
Informations about the package cloud-kms-csr
Certificate signing request and self-signed certificate generator/updater for cloud Key Management Systems
This project offers some PHP classes to use keys stored in Amazon KMS or Google Cloud KMS to create certificate signing request (CSRs) and self-signed certificates (for testing purpose).
It is based on functionalities of the SetaPDF-Signer component. The SetaPDF-Signer component is a digital signature solution for PDF documents in pure PHP.
Both AWS KMS and Google Cloud KMS allow you to store your keys on hardware security modules (HSMs). By doing this you can request certificates from certificate authorities which validate through the Adobe Approved Trust List (AATL).
The resulting certificates can then be used with the modules for the SetaPDF-Signer component:
- Module for Amazon AWS KMS
- Module for Google Cloud KMS
Installation
Add following to your composer.json:
and execute composer update
. You need to define the repository
to evaluate the dependency to the
SetaPDF-Signer component
(see here
for more details).
The Setasign repository requires authentication data: You can use your credentials of your account at setasign.com to which your licenses are assigned. You will be asked for this during a composer run. See here for more options for authentication with composer.
Depending on what KMS service you want to use make sure that you setup the authentication for them:
We use authentication data from environment variables for demonstration purpose throughout.
How it works
We implemented two classes representing a CSR and a X.509 certificate instance.
They need to be initialized by an existing CSR or certificate. For creation of
new CSRs or certificates there's a static create()
method in both classes which
uses standard OpenSSL functions to create the CSR and certificate.
Then there's an update()
method that accepts either an instance of
AwsKMS\Updater
or GoogleCloudKMS\Updater
as its parameter.
Internally all key information, algorithms and signature were updated with the use of the key stored in the KMS then.
For communication with the KMS services we use the official client libraries:
Create a self-signed certificate
Before you start to request a real certificate from a certificate authority or you simply want to test the KMS service, you can create a self-signed certificated the following way:
Google Cloud KMS
In Google Cloud KMS all things like algorithm, hash and padding are configured in the key itself. So it is straight forward to create a self-signed certificate:
AWS KMS
Nearly the same for AWS KMS. You only have to define the signature algorithm yourself. See here and here for all available algorithms. Notice that these algorithms need to be supported by the used key.
Create a CSR
Very simliar to the above examples but just use Csr
instead of Certifcate
.
Google Cloud KMS
AWS KMS
All versions of cloud-kms-csr with dependencies
ext-openssl Version *
aws/aws-sdk-php Version ^3.171
setasign/setapdf-signer Version ^2.0
google/cloud-kms Version ^1.11
phpseclib/phpseclib Version ^2.0