private function getMasterKey()
    {
        if (!$this->masterKey) {
            $certificatePath = 'file://'.$this->masterKeyData['cert_file'];
            $passPhrase = $this->masterKeyData['passphrase'];

            $this->masterKey = openssl_pkey_get_private($certificatePath, $passPhrase);
            if (!$this->masterKey) {
                throw new EncryptionException('Could not open master encryption key');
            }
        }
        return $this->masterKey;
    }