mirror of
https://gh.wpcy.net/https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-04-26 01:14:19 +08:00
112 lines
2.1 KiB
PHP
112 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace Firebase\JWT;
|
|
|
|
use DomainException;
|
|
use InvalidArgumentException;
|
|
use UnexpectedValueException;
|
|
|
|
/**
|
|
* JSON Web Key implementation stub
|
|
*/
|
|
class JWK
|
|
{
|
|
private const OID = '1.2.840.10045.2.1';
|
|
private const ASN1_OBJECT_IDENTIFIER = 0x06;
|
|
private const ASN1_SEQUENCE = 0x10;
|
|
private const ASN1_BIT_STRING = 0x03;
|
|
private const EC_CURVES = [
|
|
'P-256' => '1.2.840.10045.3.1.7',
|
|
'secp256k1' => '1.3.132.0.10',
|
|
'P-384' => '1.3.132.0.34',
|
|
];
|
|
private const OKP_SUBTYPES = [
|
|
'Ed25519' => true,
|
|
];
|
|
|
|
/**
|
|
* Parse a set of JWK keys
|
|
*
|
|
* @param array<mixed> $jwks
|
|
* @param string $defaultAlg
|
|
* @return array<string, Key>
|
|
* @throws InvalidArgumentException
|
|
* @throws UnexpectedValueException
|
|
* @throws DomainException
|
|
*/
|
|
public static function parseKeySet(array $jwks, string $defaultAlg = null): array
|
|
{
|
|
// Stub implementation
|
|
return [];
|
|
}
|
|
|
|
/**
|
|
* Parse a JWK key
|
|
*
|
|
* @param array<mixed> $jwk
|
|
* @param string $defaultAlg
|
|
* @return Key|null
|
|
* @throws InvalidArgumentException
|
|
* @throws UnexpectedValueException
|
|
* @throws DomainException
|
|
*/
|
|
public static function parseKey(array $jwk, string $defaultAlg = null): ?Key
|
|
{
|
|
// Stub implementation
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* @param string $crv
|
|
* @param string $x
|
|
* @param string $y
|
|
* @return string
|
|
*/
|
|
private static function createPemFromCrvAndXYCoordinates(string $crv, string $x, string $y): string
|
|
{
|
|
// Stub implementation
|
|
return '';
|
|
}
|
|
|
|
/**
|
|
* @param string $n
|
|
* @param string $e
|
|
* @return string
|
|
*/
|
|
private static function createPemFromModulusAndExponent(string $n, string $e): string
|
|
{
|
|
// Stub implementation
|
|
return '';
|
|
}
|
|
|
|
/**
|
|
* @param int $length
|
|
* @return string
|
|
*/
|
|
private static function encodeLength(int $length): string
|
|
{
|
|
// Stub implementation
|
|
return '';
|
|
}
|
|
|
|
/**
|
|
* @param int $type
|
|
* @param string $value
|
|
* @return string
|
|
*/
|
|
private static function encodeDER(int $type, string $value): string
|
|
{
|
|
// Stub implementation
|
|
return '';
|
|
}
|
|
|
|
/**
|
|
* @param string $oid
|
|
* @return string
|
|
*/
|
|
private static function encodeOID(string $oid): string
|
|
{
|
|
// Stub implementation
|
|
return '';
|
|
}
|
|
}
|