Jose\KeyConverter\ECKey::getXAndY PHP Method

getXAndY() private method

private getXAndY ( FG\ASN1\Object $children, string | null &$x, string | null &$y )
$children FG\ASN1\Object
$x string | null
$y string | null
    private function getXAndY(Object $children, &$x, &$y)
    {
        Assertion::isInstanceOf($children, ExplicitlyTaggedObject::class, 'Unable to load the key');
        Assertion::isArray($children->getContent(), 'Unable to load the key');
        Assertion::isInstanceOf($children->getContent()[0], BitString::class, 'Unable to load the key');
        $bits = $children->getContent()[0]->getContent();
        $bits_length = mb_strlen($bits, '8bit');
        Assertion::eq('04', mb_substr($bits, 0, 2, '8bit'), 'Unsupported key type');
        $x = mb_substr($bits, 2, ($bits_length - 2) / 2, '8bit');
        $y = mb_substr($bits, ($bits_length - 2) / 2 + 2, ($bits_length - 2) / 2, '8bit');
    }