encryptSymmWith method

DummyCastle encryptSymmWith(
  1. String plainText
)

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

param plainText to encrypt. return this object for chaining.

Implementation

DummyCastle encryptSymmWith(String plainText) {
  if (((plainText == null) || plainText.isEmpty) || (cryptSymmKey == null)) {
    exception = new Exception("Empty or null argument");
    error = true;
    return this;
  }
  try {
    resultBytes = CryptSymm.encryptStream(
        Coder.getBytesSimple(plainText), cryptSymmKey);
  } on Exception catch (e) {
    setUpError(e);
  }
  return this;
}