以编程方式加密Notes数据库

问题描述 投票:1回答:2

我需要构建一个可以加密服务器上数据库的工具。

到目前为止,我已经找到了这个信息(但是还不够)。

  1. 可以使用NSFDbIsLocallyEncrypted检查数据库是否已加密(仅在本地工作)。
  2. 创建副本W32_NSFDbCreateAndCopy并在创建副本时设置加密(将应用于副本)。>>
  3. 有一个未记录的Notes C API调用,它设置了紧凑的加密标志,但我无法使它起作用。

  4. 状态远PASCAL NSFDbLocalSecInfoSet(DBHANDLE hDB,WORD选项,BYTE EncryptStrength,字符远*用户名);

    <<
  5. 有人知道如何解决此任务吗?

    ps.s。有人告诉我,HCL将来会提供适当的解决方案(但不确定何时)。

我需要构建一个可以加密服务器上数据库的工具。到目前为止,我已经找到了此信息(但这还不够)。可以使用...

您应该查看BCC解决方案DominoProtect或Ulrich Krause还有其他解决方案,在服务器上具有数据库加密是许多合规情况的要求。

这里是工作代码。我不知道使用此代码将什么设置为EncrytionStrength即可删除本地加密。
%REM Agent encrypt Created Dec 22, 2019 by Ulrich Krause/singultus Description: Comments for Agent %END REM Option Public Option Declare Public Const W32_LIB = {nnotes.dll} Declare Function W32_NSFDbCompactExtended Lib W32_LIB Alias {NSFDbCompactExtended} (ByVal Pathname As String, Options As Long, retStats As Long) As Integer Declare Function W32_NSFDbLocalSecInfoSet Lib W32_LIB Alias {NSFDbLocalSecInfoSet} (ByVal hDb As Long, ByVal wOptions As Integer, ByVal EncryptStrength As Integer, ByVal Username As String) As Integer Declare Function W32_NSFDbIsLocallyEncrypted Lib W32_LIB Alias {NSFDbIsLocallyEncrypted} ( ByVal hDB As Long, V As Integer) As Integer Declare Sub W32_OSLoadString Lib W32_LIB Alias {OSLoadString} (ByVal null1 As Long, ByVal sError As Integer, ByVal errstr As String, ByVal lenstr As Integer) Declare Function W32_NSFDbOpen Lib W32_LIB Alias {NSFDbOpen}(ByVal dbName As String, hDb As Long) As Integer Declare Function W32_NSFDbClose Lib W32_LIB Alias {NSFDbClose} (ByVal hDb As Long) As Integer Sub Initialize Dim hDb As Long Dim rc As Integer Dim sDb As String Dim retStats As Long sDb = "serv01/singultus!!crash.nsf" rc = W32_NSFDbOpen(sDb, hDb) If rc = 0 Then rc = W32_NSFDbLocalSecInfoSet(hDb, 0,1, "") msgbox GetError(rc) If rc = 0 Then rc = W32_NSFDbCompactExtended (sDb, 0, retStats) End if rc = W32_NSFDbClose(hDb) End If End Sub Function GetError (errnum As Integer) As String Dim s As String*256 If IsDefined("WINDOWS") Then W32_OSLoadString 0, errnum And &h03FFFFFFF, s, 256 Else 'TUX_OSLoadString 0, errnum And &h03FFFFFFF, s, 256 End If getError = StrLeft(s, Chr(0)) End Function
lotus-domino lotusscript lotus
2个回答
0
投票

0
投票
%REM Agent encrypt Created Dec 22, 2019 by Ulrich Krause/singultus Description: Comments for Agent %END REM Option Public Option Declare Public Const W32_LIB = {nnotes.dll} Declare Function W32_NSFDbCompactExtended Lib W32_LIB Alias {NSFDbCompactExtended} (ByVal Pathname As String, Options As Long, retStats As Long) As Integer Declare Function W32_NSFDbLocalSecInfoSet Lib W32_LIB Alias {NSFDbLocalSecInfoSet} (ByVal hDb As Long, ByVal wOptions As Integer, ByVal EncryptStrength As Integer, ByVal Username As String) As Integer Declare Function W32_NSFDbIsLocallyEncrypted Lib W32_LIB Alias {NSFDbIsLocallyEncrypted} ( ByVal hDB As Long, V As Integer) As Integer Declare Sub W32_OSLoadString Lib W32_LIB Alias {OSLoadString} (ByVal null1 As Long, ByVal sError As Integer, ByVal errstr As String, ByVal lenstr As Integer) Declare Function W32_NSFDbOpen Lib W32_LIB Alias {NSFDbOpen}(ByVal dbName As String, hDb As Long) As Integer Declare Function W32_NSFDbClose Lib W32_LIB Alias {NSFDbClose} (ByVal hDb As Long) As Integer Sub Initialize Dim hDb As Long Dim rc As Integer Dim sDb As String Dim retStats As Long sDb = "serv01/singultus!!crash.nsf" rc = W32_NSFDbOpen(sDb, hDb) If rc = 0 Then rc = W32_NSFDbLocalSecInfoSet(hDb, 0,1, "") msgbox GetError(rc) If rc = 0 Then rc = W32_NSFDbCompactExtended (sDb, 0, retStats) End if rc = W32_NSFDbClose(hDb) End If End Sub Function GetError (errnum As Integer) As String Dim s As String*256 If IsDefined("WINDOWS") Then W32_OSLoadString 0, errnum And &h03FFFFFFF, s, 256 Else 'TUX_OSLoadString 0, errnum And &h03FFFFFFF, s, 256 End If getError = StrLeft(s, Chr(0)) End Function
© www.soinside.com 2019 - 2024. All rights reserved.