stoakes/kmip-php

There is no license information available for the latest version (dev-main) of this package.

dev-main 2024-12-02 17:39 UTC

This package is not auto-updated.

Last update: 2025-06-03 18:08:55 UTC


README

The first KMIP client library for PHP

Usage

Install the package:

composer require stoakes/kmip-php

Use it:

<?php

use Stoakes\Kmip\BaseClient;
use Stoakes\Kmip\Enum\CryptographicAlgorithm;
use Stoakes\Kmip\Enum\RevocationReasonCode;

require __DIR__ . '/vendor/autoload.php';

$client = new BaseClient('localhost', 5696,
    './server.crt',
    './server.key',
    './ca.crt',
    '2.0'
);

$client->connect();

$response = $client->createSymmetricKey(CryptographicAlgorithm::AES, 256);

$keyId = $response->batchItem[0]->responsePayload->uniqueIdentifier;

$response = $client->activate($keyId);

$response = $client->get($keyId);

$response = $client->revoke($keyId, RevocationReasonCode::CessationOfOperation);

$response = $client->destroy($keyId);

$client->disconnect();