Files
YeePay/lib/Auth/AuthorizationReqSupport.php
2024-04-01 09:54:43 +08:00

37 lines
886 B
PHP

<?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();