Hello, i am testing the use of the ChilkatDotNet2.dll with Powershell, to receive encrypted and signed emails. Some emails are encrypted / signed with OAEP / RSASSA-PSS. I download them from our emailserver, they are decrypted by the code I use etc. Everythink is working fine. I want to get information abaout the way of encryption / signing / padding of the original emails. I allways get "SigningAlg: PKCS1-V1_5" and "SigningHashAlg: sha1", even if the emails are not encrypted and signed. Here some codesnippets I use: ... $bundle = $mailman.CopyMail() ... $email = $bundle.GetEmail($i) ... $("SigningAlg: " + $email.SigningAlg) $("SigningHashAlg: " + $email.SigningHashAlg) In the dokumentation i read this: At this point, if the email was signed and/or encrypted, it is already "unwrapped", i.e. the email is already decrypted and in a state as if it were never signed or encrypted. You may check to see if the email was received encrypted or signed, and if so, whether it was successfully unwrapped and who signed or encrypted it: Maybe I get the result because the email is already unwrapped. Is there a way to get information of the original email before it is unwrapped when copying it? Regards Frank |
Hi, yes, chilcat get allways "SigningAlg: PKCS1-V1_5" and "SigningHashAlg: sha1" You can found the real information at mailman.LastErrorText (see OID) example: algId_oid = False algID_sign = False chkAlg = Split(mailman.LastErrorText, vbCrLf) For Each Eintrag In chkAlg If algId_oid Then If AlgCrypt <> "" Then AlgCrypt = AlgCrypt & " / " AlgCrypt = AlgCrypt & Trim(Eintrag) algId_oid = False End If If Eintrag.Contains("encryptionAlgorithmOid:") Then AlgCrypt = Trim(Mid(Eintrag, InStr(Eintrag, ":") + 1)) End If If Eintrag.Contains("algId_oid:") Then AlgCrypt = oid(AlgCrypt) & " / " & oid(Trim(Mid(Eintrag, InStr(Eintrag, ":") + 1))) algId_oid = True End If If Eintrag.Contains("signerDigestAlgOid:") Then AlgSign = Trim(Mid(Eintrag, InStr(Eintrag, ":") + 1)) End If If Eintrag.Contains("AlgorithmIdentifier:") Then algID_sign = True If algID_sign And Eintrag.Contains("oid:") Then AlgSign = oid(AlgSign) & " / " & oid(Trim(Mid(Eintrag, InStr(Eintrag, ":") + 1))) algID_sign = False End If If Eintrag.Contains("signerDigestAlgOid:") Then AlgSign = oid(AlgSign) & " / " & oid(Trim(Mid(Eintrag, InStr(Eintrag, ":") + 1))) End If Next Public Function oid(ByVal OIDNr As String) As String
|