private static function ensureKeyPair()
    {
        $publicKeyLocation = DIR_DATA . 'xentriq/security/xentriq.security.website.pub';
        $privateKeyLocation = DIR_DATA . 'xentriq/security/xentriq.security.website.priv';
        
        if (!file_exists($publicKeyLocation) || !file_exists($privateKeyLocation)) {
            $privateKey = openssl_pkey_new(array(
                'private_key_bits' => 2048
            ));
            
            File::setContent($privateKeyLocation, '', true);
            if (!openssl_pkey_export_to_file($privateKey, $privateKeyLocation)) {
                throw new SecurityException('Unable to generate security token');
            }
            
            $privateKeyDetails = openssl_pkey_get_details($privateKey);
            File::setContent($publicKeyLocation, $privateKeyDetails['key'], true);
        }
    }
private static function ensureKeyPair()
    {
        $publicKeyLocation = DIR_DATA . 'xentriq/security/xentriq.security.website.pub';
        $privateKeyLocation = DIR_DATA . 'xentriq/security/xentriq.security.website.priv';
        
        if (!file_exists($publicKeyLocation) || !file_exists($privateKeyLocation)) {
            $privateKey = openssl_pkey_new(array(
                'private_key_bits' => 2048
            ));
            
            File::setContent($privateKeyLocation, '', true);
            if (!openssl_pkey_export_to_file($privateKey, $privateKeyLocation)) {
                throw new SecurityException('Unable to generate security token');
            }
            
            $privateKeyDetails = openssl_pkey_get_details($privateKey);
            File::setContent($publicKeyLocation, $privateKeyDetails['key'], true);
        }
    }
private static function ensureKeyPair ( ) { $ publicKeyLocation = DIR_DATA . 'xentriq/security/xentriq.security.website.pub' ; $ privateKeyLocation = DIR_DATA . 'xentriq/security/xentriq.security.website.priv' ; if ( ! file_exists ( $ publicKeyLocation ) || ! file_exists ( $ privateKeyLocation ) ) { $ privateKey = openssl_pkey_new ( array ( 'private_key_bits' => 2048 ) ) ; File :: setContent ( $ privateKeyLocation , '' , true ) ; if ( ! openssl_pkey_export_to_file ( $ privateKey , $ privateKeyLocation ) ) { throw new SecurityException ( 'Unable to generate security token' ) ; } $ privateKeyDetails = openssl_pkey_get_details ( $ privateKey ) ; File :: setContent ( $ publicKeyLocation , $ privateKeyDetails [ 'key' ] , true ) ; } }
Ensures that the keypair essential to the security functions used in Xentriq have are available.

@throws SecurityException
Ensures that the keypair essential to the security functions used in Xentriq have are available .