# dkms-php **Repository Path**: talk-lucky/dkms-php ## Basic Information - **Project Name**: dkms-php - **Description**: Aliyun DKMS sdk. - **Primary Language**: PHP - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-25 - **Last Updated**: 2022-06-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 项目简介 阿里云 DKMS sdk. ## TIPS `Models` 结构定义在 `protubuf/protos/api.proto` 中。 生成 `Models` 的命令: ```bash protoc --php_out=./protobuf protobuf/protos/api.proto ``` ## 安装 ```bash composer require "talk-lucky/dkms" ``` ## 使用 ```php setProtocol($config["protocol"]); $configCls->setEndpoint($config["endpoint"]); $configCls->setPassword($config["password"]); $configCls->setClientKeyContent($config["clientKeyContent"]); $configCls->setCainfo($config["cainfo"]); $client = new Dkms($configCls); $keyId = ""; $val = ""; $request = new EncryptRequest(); $request->setKeyId($keyId); $request->setPlaintext($val); $resp = $client->encrypt($request); $keyId = ""; $val = ""; $iv = ""; $request = new DecryptRequest(); $request->setKeyId($keyId); $request->setCiphertextBlob($val); $request->setIv($iv); $resp = $client->decrypt($request); ```