paragonie / paserk-wrap-aws-kms
Use AWS KMS for key-wrapping with PASERK
v0.1.0
2023-08-25 13:41 UTC
Requires
- php: >= 8.1
- aws/aws-sdk-php: ^3
- paragonie/paserk: ^2
Requires (Dev)
- paragonie/certainty: ^2
- phpunit/phpunit: ^9
- vimeo/psalm: ^4
This package is auto-updated.
Last update: 2024-10-25 16:44:00 UTC
README
Integrates PASERK with AWS KMS for key-wrapping. Requires PHP 8.1 or newer.
This repository is an extension of PASERK for PHP.
PASERK Specification
The PASERK Specification can be found in this repository.
Installing
composer require paragonie/paserk-aws-kms
Usage
Initialization
You will need a KmsClient
object and
a PASETO protocol version object.
<?php use Aws\Kms\KmsClient; use ParagonIE\Paseto\ProtocolInterface; use ParagonIE\Paserk\Operations\Wrap\AwsKms; /** * @var KmsClient $kmsClient * @var ProtocolInterface $pasetoProtocol */ $awsKmsWrapper = new AwsKms($kmsClient, $pasetoProtocol);
If you'd like to specify custom Encryption Context:
$awsKmsWrapper->setEncryptionContex([ 'department' => '10103.0' ]);
You can then pass the AwsKms
object to the constructor of the PASERK Wrap
Operation class.
/** * @var AwsKms $awsKmsWrapper */ $wrapper = new \ParagonIE\Paserk\Operations\Wrap($awsKmsWrapper);
See the paserk-php documentation for further details.