first commit
This commit is contained in:
37
lib/Auth/AuthorizationReqSupport.php
Normal file
37
lib/Auth/AuthorizationReqSupport.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Yeepay\Yop\Sdk\Auth;
|
||||
|
||||
use Yeepay\Yop\Sdk\Security\DigestAlg;
|
||||
|
||||
class AuthorizationReqSupport
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private static $supportedAuthorizationReqs;
|
||||
|
||||
static function init()
|
||||
{
|
||||
self::$supportedAuthorizationReqs =
|
||||
[
|
||||
"YOP-RSA2048-SHA256" => new AuthorizationReq("RSA", "RSA2048", "SHA256withRSA", DigestAlg::SHA256,
|
||||
"YOP-RSA2048-SHA256"),
|
||||
"YOP-RSA2048-SHA512" => new AuthorizationReq("RSA", "RSA2048", "SHA512withRSA", DigestAlg::SHA512,
|
||||
"YOP-RSA2048-SHA512"),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $securityReqName
|
||||
* @return AuthorizationReq
|
||||
*/
|
||||
static function getAuthorizationReq($securityReqName)
|
||||
{
|
||||
return self::$supportedAuthorizationReqs[$securityReqName];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
AuthorizationReqSupport::init();
|
||||
Reference in New Issue
Block a user