承接 cedvict/secure 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cedvict/secure

最新稳定版本:v1.0

Composer 安装命令:

composer require cedvict/secure

包简介

Encrypt and Decrypt for Slim Framework 3

README 文档

README

Based on RSA algorithm for Slim framework. Secure works well as class library (inject) for Slim framework 3 application.

Install

You can install Logger via composer.

$ composer require cedvict/secure

Requires Slim Framework 3 and PHP 5.5.0 or newer. Visit Secure repository at Packagist.

Usage

Class Library

To use Secure as class library, you can simply inject Secure instance into Slim container.

<?php

require "vendor/autoload.php";

$container = new \Slim\Container();

// Adding logger to Slim container
$container['secure'] = function($c) {
  return new Cedvict\Secure('public_key_file', 'private_key_file', 'passphrase');
};

$app = new \Slim\App($container);

$app->get('/', function ($request, $response, $args) {

  // encrypt data before send
  $encData = $this->secure->encrypt("This message from secure class library");
  // decrypt data get
  $realData = $this->secure->decrypt($request->getParam('data'));

  return $response->write($encData . ' - ' . $realData);
});


$app->run();

统计信息

  • 总下载量: 268
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-30