encryptSymm method

DummyCastle encryptSymm()

Encrypts internally a text provided by a previous operation using symmetric encryption. The result may be obtained using getResult() method and it is not encoded. Use decryptSymm() do decrypt the result.

return this object for chaining.

Implementation

DummyCastle encryptSymm() {
  if (((resultBytes == null || resultBytes.length == 0) ||
          resultBytes.length == 0) ||
      (cryptSymmKey == null)) {
    exception = new Exception("Empty or null argument");
    error = true;
    return this;
  }
  try {
    resultBytes = CryptSymm.encryptStream(resultBytes, cryptSymmKey);
  } on Exception catch (e) {
    setUpError(e);
  }
  return this;
}