Odyssey
Public Member Functions | List of all members
HcuCuTrustedCredentialsEncryptionTest Class Reference
Inheritance diagram for HcuCuTrustedCredentialsEncryptionTest:

Public Member Functions

 setUp ()
 
 test_default_credentials_encryptions ()
 
 test_credentials_encryption_mcrypt_comptability ()
 
 tearDown ()
 

Detailed Description

Test EncryptCredentials and DecryptCredentials encryption functionalities and their migration from MCRYPT to OPENSSL.

Definition at line 12 of file sharedHcuCuTrustedDetailTest.php.

Member Function Documentation

◆ test_credentials_encryption_mcrypt_comptability()

HcuCuTrustedCredentialsEncryptionTest::test_credentials_encryption_mcrypt_comptability ( )

Test Credentials encryption migration from mcrypt to openssl

Definition at line 81 of file sharedHcuCuTrustedDetailTest.php.

81  {
82  // encrypt with mcrypt based encryption function
83  if(function_exists("EncryptCredentialsMcrypt")) {
84  // encrypt with mcrypt if applicable
85  list($ciphertext,
86  $iv_enc) = EncryptCredentialsMcrypt($this->test_credential,
87  $this->key_suffix);
88  } else {
89  // encrypt with openssl
90  list($ciphertext,
91  $iv_enc) = EncryptCredentials($this->test_credential,
92  $this->key_suffix);
93  }
94  // decryption function should be able to decrypt the data
95  // regardless of the library used for encryption
96  // decrypt with openssl
97  $obtained_decrypted_text = DecryptCredentials($ciphertext,
98  $this->key_suffix,
99  $iv_enc);
100 
101  $this->assertEquals($obtained_decrypted_text, $this->test_credential);
102  }

The documentation for this class was generated from the following file: