目录

SysIntegrityRequest

Class Info

public class SysIntegrityRequest

Builds a request class of the SysIntegrity API.

Public Constructor Summary

Constructor Name

SysIntegrityRequest()

Public Method Summary

Qualifier and Type

Method Name and Description

void

setNonce(byte[] nonce)

Sets a nonce value.

NOTE:

This parameter is mandatory.

void

setAppId(String appId)

Sets the app ID.

NOTE:

This parameter is mandatory.

void

setAlg(String alg)

Sets the signature algorithm.

NOTE:

This parameter is mandatory.

Public Constructors

[h2]SysIntegrityRequest()

Constructor

SysIntegrityRequest()

Default constructor.

Public Methods

[h2]setNonce

Method

public void setNonce(byte[] nonce)

Sets a nonce value.

Parameters

Name

Description

nonce

Cryptographic nonce value, which is used to prevent replay attacks. Ensure that the nonce value passed each time when the sysIntegrity API is called is unique. A nonce value must consist of 16 to 66 bytes.

NOTE:

This parameter is mandatory.

[h2]setAppId

Method

public void setAppId(String appId)

Sets the app ID.

Parameters

Name

Description

appId

App ID applied on HUAWEI Developers. HMS Core (APK) needs to authenticate the app ID. You need to enable the Safety Detect service for the app with this ID on the Manage APIs page in AppGallery Connect.

NOTE:

This parameter is mandatory.

[h2]setAlg

Method

public void setAlg(String alg)

Sets the signature algorithm.

Parameters

Name

Description

alg

Signature algorithm padding mode. The options include RS256 and PS256.

  • RS256: indicates to pad SHA256withRSA with PKCS1.
  • PS256: indicates to pad SHA256withRSA with PSS.
NOTE:

This parameter is mandatory. You are advised to set this parameter to PS256.