Updated on 2022-02-24 GMT+08:00

(Optional) Selecting an Encryption Algorithm Type

API Function

This API is used to configure the encryption algorithm type for sensitive information before login. Developers can select an appropriate encryption algorithm type based on the security level for their services.

API Description

public static boolean setAlgType (int type);

Class

BaseService

Parameter Description

Parameter

Mandatory or Optional

Type

Description

type

Mandatory

int

Specifies the encryption algorithm type. The value ranges from 0 to 2.

  • 0: AES 256 CBC
  • 1: AES 128 GCM
  • 2: AES 256 GCM

Return Value

Return Value

Description

true

Success

false

Failure

Output

N/A

Example

Select an encryption algorithm type.

1
2
3
private void configAlgPara() { 
    BaseService. setAlgType (2); 
}