rename crypto property
MODIFY
src/storage/mongodb/SettingStorage.ts
src/storage/mongodb/SettingStorage.ts
@@ -328,13 +328,13 @@ export default class SettingStorage {
formerKey: settings.result[0].content.crypto.formerKey,
formerKeyProperties: {
blockCypher: settings.result[0].content.crypto.formerKeyProperties?.blockCypher,
- keySize: settings.result[0].content.crypto.formerKeyProperties?.keySize,
+ blockSize: settings.result[0].content.crypto.formerKeyProperties?.blockSize,
operationMode: settings.result[0].content.crypto.formerKeyProperties?.operationMode,
},
key: settings.result[0].content.crypto.key,
keyProperties: {
blockCypher: settings.result[0].content.crypto.keyProperties.blockCypher,
- keySize: settings.result[0].content.crypto.keyProperties.keySize,
+ blockSize: settings.result[0].content.crypto.keyProperties.blockSize,
operationMode: settings.result[0].content.crypto.keyProperties.operationMode,
}
} as CryptoSetting;

MODIFY
src/types/Setting.ts
src/types/Setting.ts
@@ -252,7 +252,7 @@ export interface KeySetting extends Setting {
export interface CryptoKeyProperties {
blockCypher: string;
- keySize: number;
+ blockSize: number;
operationMode: string;
}

MODIFY
src/utils/Utils.ts
src/utils/Utils.ts
@@ -1345,13 +1345,13 @@ export default class Utils {
const regExp = /(.*?)-(.*?)-(.*)/.exec(algo);
return {
blockCypher: regExp[1].toUpperCase(),
- keySize: parseInt(regExp[2]),
+ blockSize: parseInt(regExp[2]),
operationMode: regExp[3].toUpperCase()
};
}
public static buildAlgorithm(properties: CryptoKeyProperties): string {
- return `${properties.blockCypher.toLowerCase()}-${properties.keySize}-${properties.operationMode.toLowerCase()}`;
+ return `${properties.blockCypher.toLowerCase()}-${properties.blockSize}-${properties.operationMode.toLowerCase()}`;
}
public static generateKey(): string {
@@ -1362,7 +1362,7 @@ export default class Utils {
public static getKeyProperties(): CryptoKeyProperties {
return {
blockCypher: 'AES',
- keySize: 256,
+ blockSize: 256,
operationMode: 'GCM'
};
}

MODIFY
test/api/CypherTest.ts
test/api/CypherTest.ts
@@ -23,7 +23,7 @@ const CRYPTO_KEY: CryptoSetting = {
'key': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
'keyProperties': {
'blockCypher': 'AES',
- 'keySize': 256,
+ 'blockSize': 256,
'operationMode': 'CTR'
}
};

rename crypto property