login about faq

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

asked Nov 02 at 07:27

HecCon's gravatar image

HecCon
1


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

    oid = OIDNr

    Select Case OIDNr
        Case "0.9.2342.19200300.100.1.25"
            oid = "domainComponent"
        Case "1.2.36.68980861.1.1.10"
            oid = "Signet pilot"
        Case "1.2.36.68980861.1.1.11"
            oid = "Signet intraNet"
        Case "1.2.36.68980861.1.1.2"
            oid = "Signet personal"
        Case "1.2.36.68980861.1.1.20"
            oid = "Signet securityPolicy"
        Case "1.2.36.68980861.1.1.3"
            oid = "Signet business"
        Case "1.2.36.68980861.1.1.4"
            oid = "Signet legal"

        ........

        Case "2.5.8.1"
            oid = "X.500-Alg-Encryption"
        Case "2.5.8.1.1"
            oid = "rsa"
        Case "2.5.8.2"
            oid = "DSALG_HASH" 'Digital signature algorithm applied to hashed content.
        Case "2.5.8.3"
            oid = "DSALG_SIGN" 'Digital signature algorithm applied to a signature.
    End Select

End Function
link

answered Nov 03 at 04:19

Sok1950's gravatar image

Sok1950
13449

edited Nov 03 at 04:31

Thank you very much, this solves my problem

link

answered Nov 03 at 09:56

HecCon's gravatar image

HecCon
1

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×200
×74

Asked: Nov 02 at 07:27

Seen: 114 times

Last updated: Nov 03 at 09:56

powered by OSQA