gpt4 book ai didi

lotus-domino - 以编程方式加密 Notes 数据库

转载 作者:行者123 更新时间:2023-12-02 19:45:24 24 4
gpt4 key购买 nike

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

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

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

    STATUS far PASCAL NSFDbLocalSecInfoSet(DBHANDLE hDB, WORD Option, BYTE EncryptStrength, char far *用户名);

  4. 我还了解到可以(对于较旧的 ODS 版本)更改“图标注释”或对较新的 ODS 版本使用 DBINFO3(我无法使其正常工作)

有人知道如何解决这个任务吗?

附:我被告知 HCL 将来会提供适当的解决方案(但不确定何时)。

最佳答案

这是工作代码。我不知道如何设置 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 - 以编程方式加密 Notes 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59394696/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com