Free Support Forum - aspose.com

How to use your code to valid a password for a pst

hi

I use your last version Aspose.Email.dll version 2.2

i would like to use your code :

Public Function IsPasswordValid(ByVal password As String, ByRef pst As PersonalStorage) As Boolean
Dim passwordHash As Long
’ If the property exists and is nonzero, then the PST file is password protected.
If (pst.MessageStoreProperties.Contains(MapiPropertyTag.PR_PST_PASSWORD)) Then

’ The property value contains the CRC-32 hash of the password string of PST.
passwordHash = pst.MessageStoreProperties[MapiPropertyTag.PR_PST_PASSWORD].GetLong()
If passwordHash <> 0 And passwordHash = ComputeCrc32(Encoding.ASCII.GetBytes(password)) Then
Return True
Else
Return False
End If
End If

Return False
End Function


BUT the function ComputeCrc32() does not exist !
Is it possible to get it ?

thanks for your help

marc

Hi Marc,


Thanks for writing to Aspose.Email support team.

We have forwarded this request to provide implementation of this function to our development team and will write back here as soon as some feedback is received from the developers.

Thanks for your patience and understanding in this regard.

Hi Marc,


Sorry for the delayed response.

You can refer to the following link for computing CRC32. It is in C++ and needs to be re-written in C#. Please let us know if you have any additional query in this regard.

Link: CRC Calculation