- UID
- 3388
- 积分
- 3292
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-3-28
- 最后登录
- 1970-1-1
|
发表于 2018-7-19 15:11:57
|
显示全部楼层
这个不是加密,是用口令保护DWG,
是存盘的时候,加上的。
就是调用saveAs的时候,自己加入
AcDbDatabase::saveAs Function Acad::ErrorStatus
saveAs(
const ACHAR* fileName,
const SecurityParams* pSecParams = 0);
fileName Input file name or URL to write database out to
pSecParams Input pointer to a SecurityParams structure
Runs the save process on the database and writes the drawing information out to fileName. The fileName argument is taken as is. If no file extension is present, .dwg is not appended.
If the database executing the saveAs() function is not the current database in the AutoCAD editor, then the thumbnail preview image is not saved to fileName.
To specify security parameters, set pSecurity to point to a SecurityParams struct that conveys your preferences. If pSecurity is non-NULL, its settings override any previous database security settings. If pSecurity is NULL, any currently enforced security settings remain in effect. If no previous security-related settings were specified, and pSecurity is NULL, no security-related operation is attempted. If the SecurityParams struct passed as the pSecurity argument is not properly initialized, the method fails. See SecurityParams for more information on initializing this struct.
Returns Acad::eOk if process completes successfully.
============================
SecurityParams Struct This struct stores information for security operations requested during DWG file I/O.
Inherits From
None
Include File
dbsecurity.h
Members
Member Data unsigned long cbSize
Size of the struct in bytes. This member must be set to sizeof(SecurityParams).
unsigned long ulFlags
Flags to indicate desired operations; can be one or more of the following enumerated values:
enum
{
SECURITYPARAMS_ENCRYPT_DATA = 0x00000001,
SECURITYPARAMS_ENCRYPT_PROPS = 0x00000002,
SECURITYPARAMS_SIGN_DATA = 0x00000010,
SECURITYPARAMS_ADD_TIMESTAMP = 0x00000020
};
At least one of SECURITYPARAMS_ENCRYPT_DATA or SECURITYPARAMS_SIGN_DATA must be set.
wchar_t * wszPassword
The password, formatted as a zero-terminated "wide-char" string
unsigned long ulProvType
Numeric ID of the cryptography provider. For more information on cryptography providers in Windows, please refer to the online Microsoft Developer Network (MSDN) documentation.
wchar_t * wszProvName
Name of the cryptography provider. For more information on cryptography providers in Windows, please refer to the online Microsoft Developer Network (MSDN) documentation.
unsigned long ulAlgId
Algorithm identifier; must be SECURITYPARAMS_ALGID_RC4.
unsigned long ulKeyLength
Length of the encryption key selected.
wchar_t * wszCertSubject
Name of the certificate (digital ID) subject.
wchar_t * wszCertIssuer
Name of the certificate (digital ID) issuer.
wchar_t * wszCertSerialNum
Serial number of the certificate (digital ID).
wchar_t * wszComment
Comment to be included with the signature.
wchar_t * wszTimeServer
This member contains the name of the time server used for timestamping. The name must be provided as a wide-char string in the format 揇escription(server_name)�. An example is 揘atl Inst of Standards and Technology(time.nist.gov)�.
If this member is NULL, the time from the local computer is used.
|
|