public static function generateEncryptionKeyPair(): EncryptionKeyPair
    {
        // Encryption keypair
        $kp = \sodium_crypto_box_keypair();
        $secretKey = \sodium_crypto_box_secretkey($kp);
        
        // Let's wipe our $kp variable
        \sodium_memzero($kp);
        return new EncryptionKeyPair(
            new EncryptionSecretKey(
                new HiddenString($secretKey)
            )
        );
    }
public static function generateEncryptionKeyPair(): EncryptionKeyPair
    {
        // Encryption keypair
        $kp = \sodium_crypto_box_keypair();
        $secretKey = \sodium_crypto_box_secretkey($kp);
        
        // Let's wipe our $kp variable
        \sodium_memzero($kp);
        return new EncryptionKeyPair(
            new EncryptionSecretKey(
                new HiddenString($secretKey)
            )
        );
    }
public static function generateEncryptionKeyPair ( ) : EncryptionKeyPair { // Encryption keypair $ kp = \ sodium_crypto_box_keypair ( ) ; $ secretKey = \ sodium_crypto_box_secretkey ( $ kp ) ; // Let's wipe our $kp variable \ sodium_memzero ( $ kp ) ; return new EncryptionKeyPair ( new EncryptionSecretKey ( new HiddenString ( $ secretKey ) ) ) ; }
Generate a key pair for public key encryption

@return \ParagonIE\Halite\EncryptionKeyPair

@throws InvalidKey
@throws \TypeError
Generate a key pair for public key encryption