how to set the time stamp for outlook digital signature reliable

H

Herve cadieu

Hi dear all,
I would like to be able to inject a reliable time stamp (which I get from a
reliable NTP server) into the outlook email digital signature & encryption
process instead of the local time stamp which is the normal behavior.
Anyone has an idea on how to achieve that ?

Is there any undocumented function which allow to hook in the tinmestamp
info in the selectcert structure ?
Any idea or code snippet very much appreciated.
best regards
 
E

Eric Legault [MVP - Outlook]

Hi Herve. Simply put, there is nothing you can do from a programmatic point
of view with Digital Signatures and encryption in Outlook. There's just
nothing in the Object Model that integrates with those features.
 
H

Herve cadieu

Dear Eric
Thank you for your time and answer but yes if I know that nothing is exposed
, it does not mean that nothing is possible, especially in the marvellous
hook world.

And that is what I am looking to achieve a system wide hook based on the
selectcert function structure which is used in the windows api level during
the digital signature process. in this structure we can replace (subclass)
the time stamp value as needed. But I am not at ease with hooks and I am
looking for a specialist.

But I do agree with you in saying it would be much easier if it was exposed
public methods or properties from the Outlook object model.
Having said that if I understand well you do not have a clue on how to
achieve what I am looking for ?
 
E

Eric Legault [MVP - Outlook]

Hi Herve. Do you have a link to the documentation in MSDN regarding the
Win32 API Digital Signature functionality you're talking about?

Otherwise, you're correct - I don't have a clue how to hook into this, other
than knowing there are no supported methods using Outlook automation.

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/
 
H

Herve cadieu

Hi eric,
Please just

'
//////////////////////////////////////////////////////////////////////////////////////////////////' /
' */
' dwSize size of this struct*/
' hwndParent parent of this dialog
(OPTIONAL)*/
' dwFlags flags: */
' CRYPTUI_SELECTCERT_MULTISELECT -*/
' if this flag is set then
CryptUIDlgSelectCertificate*/
' will return NULL, and the
hSelectedCertStore */
' parameter must contain a valid store
handle that */
' will be populated with all the
selected certificates.*/
' dwDontUseColumn This can be used to disable the display
of certain (OPTIONAL)*/
' columns. It can be set with any
comibnation of the*/
' column flags below*/
' szTitle title of the dialog
(OPTIONAL)*/
' szDisplayString a string that will be displayed in the
dialog that may (OPTIONAL)*/
' be used to inform the user what they are
selecting a*/
' a certificate for. if it is not set a
default string*/
' will be displayed. the defualt strings
resourece is*/
' IDS_SELECT_CERT_DEFAULT*/
' pFilterCallback a pointer to a PFNCMFILTERPROC which is
used to filter (OPTIONAL)*/
' the certificates which are displayed for
selection*/
' pDisplayCallback a pointer to a PFNCCERTDISPLAYPROC which
is used to*/
' handle displaying certificates*/
' pvCallbackData if either or both pFilterCallback or
pDisplayCallback (OPTIONAL)*/
' are being used this value is passed back
to the caller*/
' when the callbacks are made*/
' cDisplayStores count of stores that contain the certs to
display*/
' for selection*/
' rghDisplayStores array of stores that contain the certs to
display*/
' for selection*/
' cStores count of other stores to search when
building chain and (OPTIONAL)*/
' validating trust of the certs which are
displayed, if*/
' the user choosing a cert would like to
view a particular*/
' cert which is displayed for selection,
these stores*/
' are passed to the CertViewCert dialog*/
' rghStores array of other stores to search when
building chain and (OPTIONAL)*/
' validating trust of the certs which are
displayed, if*/
' the user choosing a cert would like to
view a particular*/
' cert which is displayed for selection,
these stores*/
' are passed to the CertViewCert dialog*/
' cPropSheetPages PASS THROUGH - number of pages in
rgPropSheetPages array (OPTIONAL)*/
' rgPropSheetPages PASS THROUGH - extra pages that are
passed through (OPTIONAL)*/
' to the certificate viewing dialog when it
is invoked from*/
' the selection dialog*/
' hSelectedCertStore This certificate store is passed in by
the caller if the (OPTIONAL)*/
' CRYPTUI_SELECTCERT_MULTISELECT flag is
set. The store */
' will contain all the selected
certificates on return.*/
' */
'
//////////////////////////////////////////////////////////////////////////////////////////////////' /

' flags for dwDontUseColumn*/
Private Const CRYPTUI_SELECT_ISSUEDTO_COLUMN As Long = &H1
Private Const CRYPTUI_SELECT_ISSUEDBY_COLUMN As Long = &H2
Private Const CRYPTUI_SELECT_INTENDEDUSE_COLUMN As Long = &H4
Private Const CRYPTUI_SELECT_FRIENDLYNAME_COLUMN As Long = &H8
Private Const CRYPTUI_SELECT_LOCATION_COLUMN As Long = &H10
Private Const CRYPTUI_SELECT_EXPIRATION_COLUMN As Long = &H20

' dwFlags*/
Private Const CRYPTUI_SELECTCERT_MULTISELECT As Long = &H1

Private Type CRYPTUI_SELECTCERTIFICATE_STRUCTA
dwSize As Long
hwndParent As Long ' OPTIONAL*/
dwFlags As Long ' OPTIONAL*/
szTitle As String ' OPTIONAL*/
dwDontUseColumn As Long ' OPTIONAL*/
szDisplayString As String ' OPTIONAL*/
pFilterCallback As Long ' OPTIONAL*/
pDisplayCallback As Long ' OPTIONAL*/
pvCallbackData As Long ' OPTIONAL*/
cDisplayStores As Long
rghDisplayStores As Long
cStores As Long ' OPTIONAL*/
rghStores As Long ' OPTIONAL*/
cPropSheetPages As Long ' OPTIONAL*/
rgPropSheetPages As Long ' OPTIONAL*/
hSelectedCertStore As Long ' OPTIONAL*/
End Type

' TODO: check name of "cryptui.dll" is correct
Private Declare Function CryptUIDlgSelectCertificate Lib "cryptui.dll" Alias
"CryptUIDlgSelectCertificateA" (ByVal pcsc As
CRYPTUI_SELECTCERTIFICATE_STRUCTA) As Long

Public Sub test_example()
Dim csc As CRYPTUI_SELECTCERTIFICATE_STRUCTA
Dim Cert_Context As Long
Dim h
csc.dwSize = Len(csc)
csc.szDisplayString = "Hello there!"
csc.szTitle = "My Title Here"
Stop

Cert_Context = CryptUIDlgSelectCertificate(csc)

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top