示例#1
0
 /**
  * Decodes the given encoded message and converts it into a vector with \System\System\Interaction\Message or \System\System\Interaction\Response objects.
  * @param string The encoded message.
  * @param string The custom encryptionkey. This is used over the systems default key
  * @return \System\Collection\Vector A Vector with \System\System\Interaction\Message or \System\System\Interaction\Response objects
  */
 public static final function decode($inputString, $customEncryptionKey = '')
 {
     $decodedMessage = \System\Security\AESEncoding::decode($inputString, $customEncryptionKey ?: self::getEncryptionKey(), \System\Security\AESEncoding::CYPHER_256);
     $decodedArray = json_decode($decodedMessage);
     if ($decodedArray) {
         $messages = new \System\Collection\Vector();
         foreach ($decodedArray as $message) {
             $messages[] = unserialize($message);
         }
         return $messages;
     }
     return false;
 }
示例#2
0
 /**
  * Decodes a given AES encoded string using the techniques and keys from the DynamicBaseObj.
  * @param string The encoded value
  * @return string The decoded value
  */
 public static final function decodeAES($value)
 {
     return \System\Security\AESEncoding::decode($value, self::ENCRYPTION_KEY, \System\Security\AESEncoding::CYPHER_128);
 }