methodTstCustomCipherComponent.DoneToDst
function DoneToDst: Boolean;
Finalizes a "ToDst" streaming encrypt or decrypt operation started with EncryptToDst/DecryptToDst, then calls CleanUp: on encrypt, writes the trailing cipher-MAC tag to DestinationStream when fCipherMAC is in use; on decrypt, verifies the trailing MAC or padding held back by DecryptToDst (again only when fCipherMAC is in use) and rolls DestinationStream.Size back to its start position if verification fails. Returns whether the operation (in particular MAC verification on decrypt) succeeded; a mode without tag or padding (CTR, CFB, OFB, or bpmNone on whole blocks) returns True. An application MUST call this after the last EncryptToDst/DecryptToDst call in a streaming operation to know whether decryption was authentic. The direction is Direction, or else that of the first EncryptToDst/DecryptToDst call since the key was set; with Direction cdAuto and no such call DoneToDst returns False and writes nothing - to finish an empty message, set Direction before the key or make a call of 0 octets (EncryptStreamToDst and DecryptStreamToDst make one for an empty source). On encrypt, when the padding has nothing to finish the input with - bpmNone while it is not a whole number of blocks, bpmCTS while it is shorter than one block - DoneToDst raises eSecComp (S_ERR_PartialLastBlock, S_ERR_ShortForCTS) before writing anything, and the message stays open: more EncryptToDst calls can complete it, and DoneToDst then finishes it. No client/server- specific meaning.