harmony(鸿蒙)安全子系统JS API变更

  • 2022-10-28
  • 浏览 (621)

安全子系统JS API变更

OpenHarmony 3.2 Beta3版本相较于OpenHarmony 3.2 Beta2版本,安全子系统的API变更如下:

接口变更

模块名 类名 方法/属性/枚举/常量 变更类型
ohos.privacyManager ActiveChangeResponse activeStatus: PermissionActiveStatus; 新增
ohos.privacyManager ActiveChangeResponse deviceId: string; 新增
ohos.privacyManager ActiveChangeResponse permissionName: string; 新增
ohos.privacyManager ActiveChangeResponse tokenId: number; 新增
ohos.privacyManager PermissionActiveStatus PERM_ACTIVE_IN_BACKGROUND = 2 新增
ohos.privacyManager PermissionActiveStatus PERM_ACTIVE_IN_FOREGROUND = 1 新增
ohos.privacyManager PermissionActiveStatus PERM_INACTIVE = 0 新增
ohos.privacyManager privacyManager off(type: ‘activeStateChange’, permissionNameList: Array<string>, callback?: Callback<ActiveChangeResponse>): void; 新增
ohos.privacyManager privacyManager on(type: ‘activeStateChange’, permissionNameList: Array<string>, callback: Callback<ActiveChangeResponse>): void; 新增
ohos.privacyManager privacyManager stopUsingPermission(tokenID: number, permissionName: string): Promise<number>;
stopUsingPermission(tokenID: number, permissionName: string, callback: AsyncCallback<number>): void;
新增
ohos.privacyManager privacyManager startUsingPermission(tokenID: number, permissionName: string): Promise<number>;
startUsingPermission(tokenID: number, permissionName: string, callback: AsyncCallback<number>): void;
新增
ohos.security.cryptoFramework cryptoFramework createCertChainValidator(algorithm :string) : CertChainValidator; 新增
ohos.security.cryptoFramework CertChainValidator readonly algorithm : string; 新增
ohos.security.cryptoFramework CertChainValidator validate(certChain : CertChainData, callback : AsyncCallback<void>) : void;
validate(certChain : CertChainData) : Promise<void>;
新增
ohos.security.cryptoFramework cryptoFramework createX509Crl(inStream : EncodingBlob, callback : AsyncCallback<X509Crl>) : void;
createX509Crl(inStream : EncodingBlob) : Promise<X509Crl>;
新增
ohos.security.cryptoFramework X509Crl getSignatureAlgParams() : DataBlob; 新增
ohos.security.cryptoFramework X509Crl getSignatureAlgOid() : string; 新增
ohos.security.cryptoFramework X509Crl getSignatureAlgName() : string; 新增
ohos.security.cryptoFramework X509Crl getSignature() : DataBlob; 新增
ohos.security.cryptoFramework X509Crl getTbsInfo(callback : AsyncCallback<DataBlob>) : void;
getTbsInfo() : Promise<DataBlob>;
新增
ohos.security.cryptoFramework X509Crl getRevokedCerts(callback : AsyncCallback<Array<X509CrlEntry>>) : void;
getRevokedCerts() : Promise<Array<X509CrlEntry>>;
新增
ohos.security.cryptoFramework X509Crl getRevokedCertWithCert(cert : X509Cert, callback : AsyncCallback<X509CrlEntry>) : void;
getRevokedCertWithCert(cert : X509Cert) : Promise<X509CrlEntry>;
新增
ohos.security.cryptoFramework X509Crl getRevokedCert(serialNumber : number, callback : AsyncCallback<X509CrlEntry>) : void;
getRevokedCert(serialNumber : number) : Promise<X509CrlEntry>;
新增
ohos.security.cryptoFramework X509Crl getNextUpdate() : string; 新增
ohos.security.cryptoFramework X509Crl getLastUpdate() : string; 新增
ohos.security.cryptoFramework X509Crl getIssuerName() : DataBlob; 新增
ohos.security.cryptoFramework X509Crl getVersion() : number; 新增
ohos.security.cryptoFramework X509Crl verify(key : PubKey, callback : AsyncCallback<void>) : void;
verify(key : PubKey) : Promise<void>;
新增
ohos.security.cryptoFramework X509Crl getEncoded(callback : AsyncCallback<EncodingBlob>) : void;
getEncoded() : Promise<EncodingBlob>;
新增
ohos.security.cryptoFramework X509Crl getType() : string; 新增
ohos.security.cryptoFramework X509Crl isRevoked(cert : X509Cert, callback : AsyncCallback<boolean>) : void;
isRevoked(cert : X509Cert) : Promise<boolean>;
新增
ohos.security.cryptoFramework X509CrlEntry getRevocationDate(callback : AsyncCallback<string>) : void;
getRevocationDate() : Promise<string>;
新增
ohos.security.cryptoFramework X509CrlEntry getCertIssuer(callback : AsyncCallback<DataBlob>) : void;
getCertIssuer() : Promise<DataBlob>;
新增
ohos.security.cryptoFramework X509CrlEntry getSerialNumber() : number; 新增
ohos.security.cryptoFramework X509CrlEntry getEncoded(callback : AsyncCallback<EncodingBlob>) : void;
getEncoded() : Promise<EncodingBlob>;
新增
ohos.security.cryptoFramework cryptoFramework createX509Cert(inStream : EncodingBlob, callback : AsyncCallback<X509Cert>) : void;
createX509Cert(inStream : EncodingBlob) : Promise<X509Cert>;
新增
ohos.security.cryptoFramework X509Cert getIssuerAltNames() : DataArray; 新增
ohos.security.cryptoFramework X509Cert getSubjectAltNames() : DataArray; 新增
ohos.security.cryptoFramework X509Cert getBasicConstraints() : number; 新增
ohos.security.cryptoFramework X509Cert getExtKeyUsage() : DataArray; 新增
ohos.security.cryptoFramework X509Cert getKeyUsage() : DataBlob; 新增
ohos.security.cryptoFramework X509Cert getSignatureAlgParams() : DataBlob; 新增
ohos.security.cryptoFramework X509Cert getSignatureAlgOid() : string; 新增
ohos.security.cryptoFramework X509Cert getSignatureAlgName() : string; 新增
ohos.security.cryptoFramework X509Cert getSignature() : DataBlob; 新增
ohos.security.cryptoFramework X509Cert getNotAfterTime() : string; 新增
ohos.security.cryptoFramework X509Cert getNotBeforeTime() : string; 新增
ohos.security.cryptoFramework X509Cert getSubjectName() : DataBlob; 新增
ohos.security.cryptoFramework X509Cert getIssuerName() : DataBlob; 新增
ohos.security.cryptoFramework X509Cert getSerialNumber() : number; 新增
ohos.security.cryptoFramework X509Cert getVersion() : number; 新增
ohos.security.cryptoFramework X509Cert checkValidityWithDate(date: string, callback : AsyncCallback<void>) : void;
checkValidityWithDate(date: string) : Promise<void>;
新增
ohos.security.cryptoFramework X509Cert getPublicKey(callback : AsyncCallback<PubKey>) : void;
getPublicKey() : Promise<PubKey>;
新增
ohos.security.cryptoFramework X509Cert getEncoded(callback : AsyncCallback<EncodingBlob>) : void;
getEncoded() : Promise<EncodingBlob>;
新增
ohos.security.cryptoFramework X509Cert verify(key : PubKey, callback : AsyncCallback<void>) : void;
verify(key : PubKey) : Promise<void>;
新增
ohos.security.cryptoFramework cryptoFramework createKeyAgreement(algName : string) : KeyAgreement; 新增
ohos.security.cryptoFramework KeyAgreement readonly algName : string; 新增
ohos.security.cryptoFramework KeyAgreement generateSecret(priKey : PriKey, pubKey : PubKey, callback : AsyncCallback<DataBlob>) : void;
generateSecret(priKey : PriKey, pubKey : PubKey) : Promise<DataBlob>;
新增
ohos.security.cryptoFramework cryptoFramework createVerify(algName : string) : Verify; 新增
ohos.security.cryptoFramework cryptoFramework createSign(algName : string) : Sign; 新增
ohos.security.cryptoFramework Verify readonly algName : string; 新增
ohos.security.cryptoFramework Verify verify(data : DataBlob, signatureData : DataBlob, callback : AsyncCallback<boolean>) : void;
verify(data : DataBlob, signatureData : DataBlob) : Promise<boolean>;
新增
ohos.security.cryptoFramework Verify update(data : DataBlob, callback : AsyncCallback<void>) : void;
update(data : DataBlob) : Promise<void>;
新增
ohos.security.cryptoFramework Verify init(pubKey : PubKey, callback : AsyncCallback<void>) : void;
init(pubKey : PubKey) : Promise<void>;
新增
ohos.security.cryptoFramework Sign readonly algName : string; 新增
ohos.security.cryptoFramework Sign sign(data : DataBlob, callback : AsyncCallback<DataBlob>) : void;
sign(data : DataBlob) : Promise<DataBlob>;
新增
ohos.security.cryptoFramework Sign update(data : DataBlob, callback : AsyncCallback<void>) : void;
update(data : DataBlob) : Promise<void>;
新增
ohos.security.cryptoFramework Sign init(priKey : PriKey, callback : AsyncCallback<void>) : void;
init(priKey : PriKey) : Promise<void>;
新增
ohos.security.cryptoFramework cryptoFramework createCipher(transformation : string) : Cipher; 新增
ohos.security.cryptoFramework Cipher readonly algName : string; 新增
ohos.security.cryptoFramework Cipher doFinal(data : DataBlob, callback : AsyncCallback<DataBlob>) : void;
doFinal(data : DataBlob) : Promise<DataBlob>;
新增
ohos.security.cryptoFramework Cipher update(data : DataBlob, callback : AsyncCallback<DataBlob>) : void;
update(data : DataBlob) : Promise<DataBlob>;
新增
ohos.security.cryptoFramework Cipher init(opMode : CryptoMode, key : Key, params : ParamsSpec, callback : AsyncCallback<void>) : void;
init(opMode : CryptoMode, key : Key, params : ParamsSpec) : Promise<void>;
新增
ohos.security.cryptoFramework cryptoFramework createMd(algName : string) : Md; 新增
ohos.security.cryptoFramework Md readonly algName : string; 新增
ohos.security.cryptoFramework Md getMdLength() : number; 新增
ohos.security.cryptoFramework Md digest(callback : AsyncCallback<DataBlob>) : void;
digest() : Promise<DataBlob>;
新增
ohos.security.cryptoFramework Md update(input : DataBlob, callback : AsyncCallback<void>) : void;
update(input : DataBlob) : Promise<void>;
新增
ohos.security.cryptoFramework cryptoFramework createMac(algName : string) : Mac; 新增
ohos.security.cryptoFramework Mac readonly algName : string; 新增
ohos.security.cryptoFramework Mac getMacLength() : number; 新增
ohos.security.cryptoFramework Mac doFinal(callback : AsyncCallback<DataBlob>) : void;
doFinal() : Promise<DataBlob>;
新增
ohos.security.cryptoFramework Mac update(input : DataBlob, callback : AsyncCallback<void>) : void;
update(input : DataBlob) : Promise<void>;
新增
ohos.security.cryptoFramework Mac init(key : SymKey, callback : AsyncCallback<void>) : void;
init(key : SymKey) : Promise<void>;
新增
ohos.security.cryptoFramework cryptoFramework createSymKeyGenerator(algName : string) : SymKeyGenerator; 新增
ohos.security.cryptoFramework cryptoFramework createAsyKeyGenerator(algName : string) : AsyKeyGenerator; 新增
ohos.security.cryptoFramework SymKeyGenerator readonly algName : string; 新增
ohos.security.cryptoFramework SymKeyGenerator convertKey(key : DataBlob, callback : AsyncCallback<SymKey>) : void;
convertKey(key : DataBlob) : Promise<SymKey>;
新增
ohos.security.cryptoFramework SymKeyGenerator generateSymKey(callback : AsyncCallback<SymKey>) : void;
generateSymKey() : Promise<SymKey>;
新增
ohos.security.cryptoFramework AsyKeyGenerator readonly algName : string; 新增
ohos.security.cryptoFramework AsyKeyGenerator convertKey(pubKey : DataBlob, priKey : DataBlob, callback : AsyncCallback<KeyPair>) : void;
convertKey(pubKey : DataBlob, priKey : DataBlob) : Promise<KeyPair>;
新增
ohos.security.cryptoFramework AsyKeyGenerator generateKeyPair(callback : AsyncCallback<KeyPair>) : void;
generateKeyPair() : Promise<KeyPair>;
新增
ohos.security.cryptoFramework cryptoFramework createRandom() : Random; 新增
ohos.security.cryptoFramework Random setSeed(seed : DataBlob, callback : AsyncCallback<void>) : void;
setSeed(seed : DataBlob) : Promise<void>;
新增
ohos.security.cryptoFramework Random generateRandom(len : number, callback: AsyncCallback<DataBlob>) : void;
generateRandom(len : number) : Promise<DataBlob>;
新增
ohos.security.cryptoFramework KeyPair readonly pubKey : PubKey; 新增
ohos.security.cryptoFramework KeyPair readonly priKey : PriKey; 新增
ohos.security.cryptoFramework PriKey clearMem() : void; 新增
ohos.security.cryptoFramework SymKey clearMem() : void; 新增
ohos.security.cryptoFramework Key readonly algName : string; 新增
ohos.security.cryptoFramework Key readonly format : string; 新增
ohos.security.cryptoFramework Key getEncoded() : DataBlob; 新增
ohos.security.cryptoFramework CryptoMode DECRYPT_MODE = 1 新增
ohos.security.cryptoFramework CryptoMode ENCRYPT_MODE = 0 新增
ohos.security.cryptoFramework CcmParamsSpec authTag : DataBlob; 新增
ohos.security.cryptoFramework CcmParamsSpec aad : DataBlob; 新增
ohos.security.cryptoFramework CcmParamsSpec iv : DataBlob; 新增
ohos.security.cryptoFramework GcmParamsSpec authTag : DataBlob; 新增
ohos.security.cryptoFramework GcmParamsSpec aad : DataBlob; 新增
ohos.security.cryptoFramework GcmParamsSpec iv : DataBlob; 新增
ohos.security.cryptoFramework IvParamsSpec iv : DataBlob; 新增
ohos.security.cryptoFramework ParamsSpec algoName : string; 新增
ohos.security.cryptoFramework CertChainData encodingFormat: EncodingFormat; 新增
ohos.security.cryptoFramework CertChainData count : number; 新增
ohos.security.cryptoFramework CertChainData data: Uint8Array; 新增
ohos.security.cryptoFramework EncodingBlob encodingFormat : EncodingFormat; 新增
ohos.security.cryptoFramework EncodingBlob data : Uint8Array; 新增
ohos.security.cryptoFramework EncodingFormat FORMAT_PEM = 1 新增
ohos.security.cryptoFramework EncodingFormat FORMAT_DER = 0 新增
ohos.security.cryptoFramework DataArray data : Array<Uint8Array>; 新增
ohos.security.cryptoFramework DataBlob data : Uint8Array; 新增
ohos.security.cryptoFramework Result ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE = 17630007 新增
ohos.security.cryptoFramework Result ERR_KEYUSAGE_NO_CERTSIGN = 17630006 新增
ohos.security.cryptoFramework Result ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY = 17630005 新增
ohos.security.cryptoFramework Result ERR_CERT_HAS_EXPIRED = 17630004 新增
ohos.security.cryptoFramework Result ERR_CERT_NOT_YET_VALID = 17630003 新增
ohos.security.cryptoFramework Result ERR_CERT_SIGNATURE_FAILURE = 17630002 新增
ohos.security.cryptoFramework Result ERR_CRYPTO_OPERATION = 17630001 新增
ohos.security.cryptoFramework Result ERR_EXTERNAL_ERROR = 17620002 新增
ohos.security.cryptoFramework Result ERR_OUT_OF_MEMORY = 17620001 新增
ohos.security.cryptoFramework Result NOT_SUPPORT = 801 新增
ohos.security.cryptoFramework Result INVALID_PARAMS = 401 新增
ohos.security.huks HuksTag HUKS_TAG_CHALLENGE_POS = HuksTagType.HUKS_TAG_TYPE_UINT 310
ohos.security.huks HuksTag HUKS_TAG_CHALLENGE_TYPE = HuksTagType.HUKS_TAG_TYPE_UINT 309
ohos.security.huks HuksTag HUKS_TAG_KEY_SECURE_SIGN_TYPE = HuksTagType.HUKS_TAG_TYPE_UINT 308
ohos.security.huks HuksTag HUKS_TAG_KEY_AUTH_ACCESS_TYPE = HuksTagType.HUKS_TAG_TYPE_UINT 307
ohos.security.huks HuksSecureSignType HUKS_SECURE_SIGN_WITH_AUTHINFO = 1 新增
ohos.security.huks HuksChallengePosition HUKS_CHALLENGE_POS_3 新增
ohos.security.huks HuksChallengePosition HUKS_CHALLENGE_POS_2 新增
ohos.security.huks HuksChallengePosition HUKS_CHALLENGE_POS_1 新增
ohos.security.huks HuksChallengePosition HUKS_CHALLENGE_POS_0 = 0 新增
ohos.security.huks HuksChallengeType HUKS_CHALLENGE_TYPE_NONE = 2 新增
ohos.security.huks HuksChallengeType HUKS_CHALLENGE_TYPE_CUSTOM = 1 新增
ohos.security.huks HuksChallengeType HUKS_CHALLENGE_TYPE_NORMAL = 0 新增
ohos.security.huks HuksAuthAccessType HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL = 1 << 1 新增
ohos.security.huks HuksAuthAccessType HUKS_AUTH_ACCESS_INVALID_CLEAR_PASSWORD = 1 << 0 新增
ohos.security.huks HuksUserAuthType HUKS_USER_AUTH_TYPE_PIN = 1 << 2 新增
ohos.security.huks HuksUserAuthType HUKS_USER_AUTH_TYPE_FACE = 1 << 1 新增
ohos.security.huks HuksUserAuthType HUKS_USER_AUTH_TYPE_FINGERPRINT = 1 << 0 新增
ohos.security.huks HuksErrorCode HUKS_ERROR_DEVICE_NO_CREDENTIAL = -44 新增
ohos.security.huks HuksErrorCode HUKS_ERROR_KEY_AUTH_FAILED = -43 新增
ohos.security.huks HuksErrorCode HUKS_ERROR_USER_AUTH_TYPE_NOT_SUPPORT = -42 新增
ohos.security.huks HuksErrorCode HUKS_ERROR_GET_USERIAM_AUTHINFO_FAILED = -41 新增
ohos.security.huks HuksErrorCode HUKS_ERROR_GET_USERIAM_SECINFO_FAILED = -40 新增
ohos.security.huks huks attestKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback<HuksResult>) : void;
attestKey(keyAlias: string, options: HuksOptions) : Promise<HuksResult>;
新增

你可能感兴趣的鸿蒙文章

harmony(鸿蒙)Readme

harmony(鸿蒙)3.2 beta3相对于3.2 beta2变更详细说明

harmony(鸿蒙)元能力子系统JS API变更

harmony(鸿蒙)无障碍子系统JS API变更

harmony(鸿蒙)帐号子系统JS API变更

harmony(鸿蒙)ArkUI子系统JS API变更

harmony(鸿蒙)电源服务子系统JS API变更

harmony(鸿蒙)包管理子系统JS API变更

harmony(鸿蒙)基础通信子系统JS API变更

harmony(鸿蒙)公共基础库子系统JS API变更

0  赞