decrypt method
Decrypts the current CMS/PKCS #7 encrypted MIME entity and replaces it with the recovered MIME content. Chilkat identifies the intended recipient from the CMS recipient information and searches configured credential sources for the matching certificate and private key.
SourceHow it is supplied
| Explicit certificate | | addDecryptCert or decryptUsingCert |
| PFX/P12 | | addPfxSourceFile, addPfxSourceBd, or a
DecryptUsingPfx... method |
| Certificate vault | | useCertVault |
| Platform certificate store | | Windows certificate stores and the macOS Keychain are searched automatically where supported |
On success, numDecryptCerts and lastDecryptCert identify the certificate used, and getLastJsonData reports the content-encryption algorithm and key size. On failure, the encrypted MIME remains unchanged.
Serialization after decryption. The recovered MIME content is restored semantically, but its generated serialization is not guaranteed to be byte-for-byte identical to the bytes that existed before encryption.
Throws a ChilkatException if the call fails; the details are in ChilkatException.lastErrorText.
Implementation
void decrypt() {
final h = _handle;
final r = _CkMime_Decrypt(h);
if (r == 0) {
throw _fail('decrypt');
}
}