openharmony 鸿蒙 arkts-basic-components-web-ClientAuthenticationHandler

2026-08-25 浏览 (1)

Class (ClientAuthenticationHandler)

Implements a ClientAuthenticationHandler object to handle SSL client certificate request events returned by the Web component. For details about the sample code, see onClientAuthenticationRequest.

NOTE

  • This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.

  • The initial APIs of this class are supported since API version 9.

  • The sample effect is subject to the actual device.

constructor9+

constructor()

Constructs a ClientAuthenticationHandler.

System capability: SystemCapability.Web.Webview.Core

confirm9+

confirm(priKeyFile : string, certChainFile : string): void

Uses the specified private key and client certificate chain.

System capability: SystemCapability.Web.Webview.Core

Parameters

NameTypeMandatoryDescription
priKeyFilestringYesFull path for storing the private key file.
certChainFilestringYesFull path for storing the certificate chain file.

confirm10+

confirm(authUri : string): void

Instructs the Web component to use the specified credentials (obtained from the certificate management module).

NOTE

The ohos.permission.ACCESS_CERT_MANAGER permission must be declared.

System capability: SystemCapability.Web.Webview.Core

Parameters

NameTypeMandatoryDescription
authUristringYesKey value of the credentials.

The following table lists the supported certificate signature algorithms and key lengths.

Signing AlgorithmKey Length
SSL_SIGN_RSA_PKCS1_SHA2561024 (supported since API version 18), 2048, 3072, and 4096
SSL_SIGN_RSA_PKCS1_SHA3841024 (supported since API version 18), 2048, 3072, and 4096
SSL_SIGN_RSA_PKCS1_SHA5121024 (supported since API version 18), 2048, 3072, and 4096
SSL_SIGN_RSA_PSS_SHA2561024 (supported since API version 18), 2048, 3072, and 4096
SSL_SIGN_RSA_PSS_SHA3841024 (supported since API version 18), 2048, 3072, and 4096
SSL_SIGN_RSA_PSS_SHA5121024 (supported since API version 18), 2048, 3072, and 4096
SSL_SIGN_ECDSA_SECP256R1_SHA256256
SSL_SIGN_ECDSA_SECP384R1_SHA384384
SSL_SIGN_ECDSA_SECP521R1_SHA512521

confirm22+

confirm(identity: string, credentialTypeOrCertChainFile: CredentialType |string): void

Instructs the Web component to use the specified credential and credential type obtained from the certificate management module.

System capability: SystemCapability.Web.Webview.Core

Parameters

NameTypeMandatoryDescription
identitystringYesUnique ID of a credential.
credentialTypeOrCertChainFileCredentialType |stringYesCredentialType indicates the credential type. string indicates the certificate chain file path.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
801Capability not supported.

cancel9+

cancel(): void

Cancels the client certificate request sent by the same host and port server. No additional event will be reported for requests from the same host and port server.

System capability: SystemCapability.Web.Webview.Core

ignore9+

ignore(): void

Ignores this request.

System capability: SystemCapability.Web.Webview.Core

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 arkts-apis-webview-WebviewController

openharmony 鸿蒙 arkts-apis-webview-t

openharmony 鸿蒙 arkts-apis-webview

openharmony 鸿蒙 capi-arkweb-type-h

openharmony 鸿蒙 arkts-basic-components-web-FullScreenExitHandler

openharmony 鸿蒙 arkts-apis-webview-WebDownloadManager

openharmony 鸿蒙 arkts-basic-components-web-VerifyPinHandler

openharmony 鸿蒙 capi-web-arkweb-webmessage8h

openharmony 鸿蒙 arkts-apis-webview-NativeMediaPlayerHandler

openharmony 鸿蒙 capi-web-arkweb-proxymethodwithresult

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/Q7Y4EeOh