!132 [新需求]: 支持安装crt和der格式的用户CA证书

Merge pull request !132 from HaixiangW/master
This commit is contained in:
openharmony_ci 2024-11-18 06:29:22 +00:00 committed by Gitee
commit df4d0bc562
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 4 additions and 4 deletions

View File

@ -15,6 +15,6 @@
export default class FilterParams {
public static readonly MAX_SELECT_FILE_NUM = 1;
public static readonly CERT_FILE_SUFFIX = ['.pem,.cer'];
public static readonly CERT_FILE_SUFFIX = ['.pem,.cer,.crt,.der'];
public static readonly CREDENTIAL_FILE_SUFFIX = ['.pfx,.p12'];
}

View File

@ -164,7 +164,7 @@ export struct CertInstallFromStorage {
FileIoModel.getMediaFileSuffix(fileUri, (suffix: string | undefined) => {
if (suffix !== undefined) {
console.debug(TAG, 'suffix = ', suffix);
if ((suffix === 'cer') || (suffix === 'pem')) {
if ((suffix === 'cer') || (suffix === 'pem') || (suffix === 'crt') || (suffix === 'der')) {
CmInstallPresenter.getInstance().installCert(fileUri, '', suffix, false);
} else {
this.mFaPresenter.unrecognizedFileTips();

View File

@ -65,7 +65,7 @@ export default class CmFaPresenter {
FileIoModel.getMediaFileSuffix(fileUri, (suffix: string | undefined) => {
if (suffix !== undefined) {
console.debug(TAG, 'suffix = ', suffix);
if ((suffix === 'cer') || (suffix === 'pem')) {
if ((suffix === 'cer') || (suffix === 'pem') || (suffix === 'crt') || (suffix === 'der')) {
CmInstallPresenter.getInstance().installCert(fileUri, '', suffix, true);
} else {
this.unrecognizedFileTips();

View File

@ -49,7 +49,7 @@ export default class CmInstallPresenter {
updateCertFileType(suffix: string): void {
console.debug(TAG + 'updateCertFileType suffix: ' + suffix);
if ((suffix === 'cer') || (suffix === 'pem')) {
if ((suffix === 'cer') || (suffix === 'pem') || (suffix === 'crt') || (suffix === 'der')) {
this.optType = CMModelOptType.CM_MODEL_OPT_USER_CA;
} else if (((suffix === 'p12') || (suffix === 'jks') || (suffix === 'pfx')) &&
AppStorage.get('installUserCred') === true) {