Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 8 Forum

Notes/Domino 8 Forum

Subject: SECRecoverIDFile API call
Feedback Type: Problem
Product Area: Notes 8 Client
Technical Area: New Features
Platform: Windows XP client
Release: Beta 2
Reproducible: Always

I was having a play about with the new password recovery API's, and I stumbled across a couple of issues with the SECRecoverIDFile function.

I'll start off by saying that I'm no expert when it comes to C - I have a little knowledge (and it is a dangerous thing, believe me :), so it's quite possible that I'm just doing something wrong here. On the other hand, I've checked and double checked everything I'm doing, and I'm fairly sure I'm not doing anything wrong, so here goes...

Firstly, if I try and compile the Notes 8 preliminary C API release in a C application, the new function calls don't appear to be present:

error LNK2019: unresolved external symbol _SECRecoverIDFile@28 referenced in function _main
error LNK2019: unresolved external symbol _SECExtractRecoveryPassword@36 referenced in function _main

OK, so failing that, I've tried calling the C API functions from within LotusScript - this has been marginally more successful. I've created an agent which opens the ID file for the recovery authority (SECKFMOpen), extracts the recovery password from the backup ID (SECExtractRecoveryPassword), tries to recover the ID file (SECRecoverIDFile), and closes the ID file again (SECKFMClose) - the bit that I'm having trouble with is recovering the ID file itself - every time I try, I get error 6408 - "Wrong Password. (Passwords are case sensitive - be sure to use correct upper and lower case.)" returned.

For what it's worth, here are the LS declarations I'm making:

Type TIMEDATE
Innards(1) As Long
End Type

Type PASSWORDS
Password1 As String
Password2 As String
Password3 As String
Password4 As String
Password5 As String
Password6 As String
Password7 As String
Password8 As String
End Type

Declare Function SECKFMOpen Lib "nnotes.dll"_
(KFHANDLE As Long,_
Byval pIDFileName As String,_
Byval pPassword As String,_
Byval Flags As Long,_
Byval Reserved As Long,_
pReserved As Long) As Integer

Declare Function SECKFMClose Lib "nnotes.dll"_
(KFHANDLE As Long,_
Byval Flags As Long,_
Byval Reserved As Long,_
pReserved As Any) As Integer

Declare Function SECExtractRecoveryPassword Lib "nnotes.dll"_
(Byval KFHANDLE As Long,_
Byval pIDFileName As String,_
Byval retRecoveryPassword As String,_
Byval MaxRecoveryPasswordLength As Integer,_
retRecoveryPasswordLen As Integer,_
retCreationTimeDate As TIMEDATE,_
retAcceptanceTimeDate As TIMEDATE,_
pReserved As Long,_
Byval ReservedFlags As Long) As Integer

Declare Function SECRecoverIDFile Lib "nnotes.dll" _
(Byval pIDFileName As String,_
NumPasswords As Integer,_
pPassword As Any,_
Byval pNewPassword As String,_
Byval NewPasswordLen As Integer,_
pReserved As Long,_
Byval ReservedFlags As Long) As Integer

And here is the code, with location-specific stuff taken out (please note, this is just quick and dirty code for the purpose of testing these API calls :)

Sub Initialize

Dim idHandle As Long
Dim result As Integer
Dim recoverypassword As String*16
Dim recoverypasswordlength As Integer
Dim date1 As TIMEDATE
Dim date2 As TIMEDATE
Dim pw As PASSWORDS

Dim ra As String
Dim raPwd As String
Dim idToRecover As String
Dim newPassword As String

ra = "" ' Location of recovery authority ID
raPwd = "" ' Recovery authority password
idToRecover = "" ' Location of id to recover
newPassword = "" ' New password for id to recover

result = SECKFMOpen(idHandle, ra, raPwd, 0, 0, 0)
Print getError(result)
result = SECExtractRecoveryPassword(idHandle, idToRecover,recoverypassword, 16, recoverypasswordlength, date1, date2, 0, 0)
Print getError(result)
pw.password1 = recoverypassword
result = SECRecoverIDFile(idToRecover, 1, pw, newPassword, len(newPassword), 0, 0)
Print getError(result)
result = SECKFMClose(idHandle, 0, 0 ,0)
Print getError(result)

End Sub

The getError function is just a simple API call to OSLoadString to get the error message associated with a number. The output I get from this is:

No error
No error
Wrong Password. (Passwords are case sensitive - be sure to use correct upper and lower case.)
No error

I've set up test recovery information - this consists of 2 generic ID's as recovery authorities, and only one password is needed to recover an ID file.

I've tried passing the passwords array in as a regular lotusscript string array as well, with the same result.

Thanks


Feedback number WEBB6ZMFUX created by Matt Buchanan on 03/25/2007

Status: Open
Comments:

SECRecoverIDFile API call (Matt Buchanan 25.Mar.07)
. . SPR# RPAI739LBJ deals with the APIs... (Katherine Holde... 31.May.07)
. . Change the declaration of SECRecove... (Hein Corbet 6.Dec.07)
. . . . Recover API (Lars Liltorp 11.Jun.08)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support


 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite