IX509EnrollmentHelper::AddEnrollmentServer 方法 (certenroll.h)
AddEnrollmentServer方法會將憑證註冊伺服器 (CES) 存取認證儲存在認證快取中。 此方法已啟用 Web。
語法
HRESULT AddEnrollmentServer(
[in] BSTR strEnrollmentServerURI,
[in] X509EnrollmentAuthFlags authFlags,
[in] BSTR strCredential,
[in] BSTR strPassword
);
參數
[in] strEnrollmentServerURI
包含憑證註冊伺服器 URL 的 BSTR 。
[in] authFlags
指定用戶端驗證類型的 X509EnrollmentAuthFlags 列舉值。 這可以是下列其中一個值。
[in] strCredential
包含認證的 BSTR 。
[in] strPassword
包含純文字密碼的 BSTR 。
傳回值
如果函式成功,函式會傳回 S_OK。
如果函式失敗,它會傳回 指出錯誤的 HRESULT 值。 可能的值包括 (但不限於) 下表中的這些值。 如需常見錯誤碼的清單,請參閱 一般 HRESULT 值。
傳回碼 | Description |
---|---|
|
strEnrollmentServerURI參數不可為Null或空白。
如果在 authFlags 參數中指定 X509AuthAnonymous 或 X509AuthKerberos, strCredential 參數不得為 Null。 如果在 authFlags 參數中指定 X509AuthCertificate, strCredential 參數必須是 Null。 如果在 authFlags 參數中指定的 X509AuthCertificateis, strPassword 參數必須是 Null,但 strCredential 參數不得為 。 |
|
strPassword、strCredential或strEnrollmentServerURI參數超過 64,000 個字元,或包含內嵌的 Null 字元。 |
備註
strCredential和strPassword引數會根據authFlags引數中指定的值而變更,如下表所示。
flag 參數 | strCredential 參數 | strPassword 參數 |
---|---|---|
X509AuthAnonymous | NULL | NULL |
X509AuthKerberos | NULL | NULL |
X509AuthUsername | CEP 伺服器可辨識的純文字使用者名稱。 | 與使用者名稱相關聯的純文字密碼。 |
X509AuthCertificate | 包含憑證的 20 位元組 SHA-1 雜湊 (指紋) 。 | NULL |
規格需求
最低支援的用戶端 | Windows 7 [僅限傳統型應用程式] |
最低支援的伺服器 | Windows Server 2008 R2 [僅限桌面應用程式] |
目標平台 | Windows |
標頭 | certenroll.h |