Closed cjango closed 2 months ago
function get_public_cert(string $key): string { return is_file($key) ? file_get_contents($key) : $key; } function get_private_cert(string $key): string { if (is_file($key)) { return file_get_contents($key); } return "-----BEGIN RSA PRIVATE KEY-----\n". wordwrap($key, 64, "\n", true). "\n-----END RSA PRIVATE KEY-----"; }
https://github.com/yansongda/pay/blob/master/tests/FunctionTest.php#L61-L75