改名
This commit is contained in:
@@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Kiri\Jwt;
|
|
||||||
|
|
||||||
class JWTConstant
|
|
||||||
{
|
|
||||||
|
|
||||||
const AES_128_ECB = 'aes-128-ecb';
|
|
||||||
const AES_192_ECB = 'aes-192-ecb';
|
|
||||||
const AES_256_ECB = 'aes-256-ecb';
|
|
||||||
const ARIA_128_ECB = 'aria-128-ecb';
|
|
||||||
const ARIA_192_ECB = 'aria-192-ecb';
|
|
||||||
const ARIA_256_ECB = 'aria-256-ecb';
|
|
||||||
const BF_ECB = 'bf-ecb';
|
|
||||||
const CAMELLIA_128_ECB = 'camellia-128-ecb';
|
|
||||||
const CAMELLIA_192_ECB = 'camellia-192-ecb';
|
|
||||||
const CAMELLIA_256_ECB = 'camellia-256-ecb';
|
|
||||||
const CAST5_ECB = 'cast5-ecb';
|
|
||||||
const DES_ECB = 'des-ecb';
|
|
||||||
const DES_EDE = 'des-ede';
|
|
||||||
const DES_EDE3 = 'des-ede3';
|
|
||||||
const ID_SMIME_ALG_CMS3DESWRAP = 'id-smime-alg-CMS3DESwrap';
|
|
||||||
const IDEA_ECB = 'idea-ecb';
|
|
||||||
const RC2_ECB = 'rc2-ecb';
|
|
||||||
const RC4 = 'rc4';
|
|
||||||
const RC4_40 = 'rc4-40';
|
|
||||||
const RC4_HMAC_MD5 = 'rc4-hmac-md5';
|
|
||||||
const SEED_ECB = 'seed-ecb';
|
|
||||||
const SM4_ECB = 'sm4-ecb';
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -46,9 +46,7 @@ class Jwt extends Component
|
|||||||
$jwt = Config::get('jwt', []);
|
$jwt = Config::get('jwt', []);
|
||||||
if ($jwt) {
|
if ($jwt) {
|
||||||
$this->setScene($jwt['scene'] ?? 'application');
|
$this->setScene($jwt['scene'] ?? 'application');
|
||||||
$this->setEncrypt($jwt['encrypt'] ?? JWTConstant::AES_128_ECB);
|
|
||||||
$this->setKey($jwt['key'] ?? get_called_class());
|
$this->setKey($jwt['key'] ?? get_called_class());
|
||||||
|
|
||||||
$length = openssl_cipher_iv_length($this->encrypt);
|
$length = openssl_cipher_iv_length($this->encrypt);
|
||||||
if ($length > 0) {
|
if ($length > 0) {
|
||||||
$defaultIv = openssl_random_pseudo_bytes($length);
|
$defaultIv = openssl_random_pseudo_bytes($length);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ trait JwtHelper
|
|||||||
private string $scene = 'default';
|
private string $scene = 'default';
|
||||||
|
|
||||||
|
|
||||||
private string $encrypt = '';
|
private string $encrypt = 'aes-128-ecb';
|
||||||
|
|
||||||
|
|
||||||
private string $iv = '';
|
private string $iv = '';
|
||||||
|
|||||||
Reference in New Issue
Block a user