diff --git a/hmac-sign/index.ts b/hmac-sign/index.ts index 136fb5e..4616a77 100644 --- a/hmac-sign/index.ts +++ b/hmac-sign/index.ts @@ -45,8 +45,8 @@ export async function execute(context: Context): Promise { } async function signContent(context: Context, contentBytes: SecureByteArray): Promise { - const algorithmParams = { name: "HMAC", hash: context.parameters.hmacHashAlgorithmName }; - const keyUse = ["sign"]; + const algorithmParams: HmacImportParams = { name: "HMAC", hash: context.parameters.hmacHashAlgorithmName }; + const keyUse: KeyUsage[] = ["sign"]; const privateKey = await crypto.subtle.importKey("cryptosecret", context.parameters.cryptoSecretParameter, algorithmParams, false, keyUse); return await crypto.subtle.sign("HMAC", privateKey, contentBytes); diff --git a/hmac-verify/index.ts b/hmac-verify/index.ts index 33ced8e..bbd4f37 100644 --- a/hmac-verify/index.ts +++ b/hmac-verify/index.ts @@ -57,8 +57,8 @@ export async function execute(context: Context): Promise { } async function verifyContent(context: Context, signatureBytes: Uint8Array, contentBytes: SecureByteArray): Promise { - const algorithmParams = { name: "HMAC", hash: context.parameters.hmacHashAlgorithmName }; - const keyUse = ["verify"]; + const algorithmParams: HmacImportParams = { name: "HMAC", hash: context.parameters.hmacHashAlgorithmName }; + const keyUse: KeyUsage[] = ["verify"]; const publicKey = await crypto.subtle.importKey("cryptosecret", context.parameters.cryptoSecretParameter, algorithmParams, false, keyUse); return await crypto.subtle.verify("HMAC", publicKey, signatureBytes, contentBytes); diff --git a/multiple-resource-copy/index.ts b/multiple-resource-copy/index.ts index 1b54372..2f83470 100644 --- a/multiple-resource-copy/index.ts +++ b/multiple-resource-copy/index.ts @@ -1,4 +1,4 @@ -export function getDescription(): ScriptDescription { +export function getDescription() { return { displayName: "Multiple Resource Copy", description: "Copies multiple resources into a target directory. It has no size limit; the amount of transferred data is only limited by the step timeout.", @@ -80,7 +80,7 @@ export function getDescription(): ScriptDescription { description: "Number of files that failed to be copied.", }, ], - }; + } as const satisfies ScriptDescription; } export async function execute(context: Context): Promise { diff --git a/resource-copy/index.ts b/resource-copy/index.ts index 8276500..3c3ea74 100644 --- a/resource-copy/index.ts +++ b/resource-copy/index.ts @@ -1,4 +1,4 @@ -export function getDescription(): ScriptDescription { +export function getDescription() { return { displayName: "Resource Copy", description: "Copies an input resource into an output resource.", @@ -33,7 +33,7 @@ export function getDescription(): ScriptDescription { }, ], output: [], - }; + } as const satisfies ScriptDescription; } export async function execute(context: Context): Promise { diff --git a/rsa-sign/index.ts b/rsa-sign/index.ts index ae28460..3c5201c 100644 --- a/rsa-sign/index.ts +++ b/rsa-sign/index.ts @@ -51,8 +51,8 @@ export async function execute(context: Context): Promise { } async function signContent(context: Context, fileToSign: IFile): Promise { - const algorithmParams = { name: context.parameters.rsaAlgorithmName, hash: context.parameters.rsaHashAlgorithmName }; - const keyUse = ["sign"]; + const algorithmParams: RsaHashedImportParams = { name: context.parameters.rsaAlgorithmName, hash: context.parameters.rsaHashAlgorithmName }; + const keyUse: KeyUsage[] = ["sign"]; const privateKey = await crypto.subtle.importKey("pkcs8fromparameterinput", context.parameters.privateCertificate, algorithmParams, false, keyUse); return await crypto.subtle.sign(context.parameters.rsaAlgorithmName, privateKey, fileToSign); diff --git a/rsa-verify/index.ts b/rsa-verify/index.ts index 84f89e8..26eb742 100644 --- a/rsa-verify/index.ts +++ b/rsa-verify/index.ts @@ -64,8 +64,8 @@ export async function execute(context: Context): Promise { } async function verifyContent(context: Context, signatureBytes: Uint8Array, fileToVerify: IFile): Promise { - const algorithmParams = { name: context.parameters.rsaAlgorithmName, hash: context.parameters.rsaHashAlgorithmName }; - const keyUse = ["verify"]; + const algorithmParams: RsaHashedImportParams = { name: context.parameters.rsaAlgorithmName, hash: context.parameters.rsaHashAlgorithmName }; + const keyUse: KeyUsage[] = ["verify"]; const publicKey = await crypto.subtle.importKey("spkifromparameterinput", context.parameters.publicCertificate, algorithmParams, false, keyUse); return await crypto.subtle.verify(context.parameters.rsaAlgorithmName, publicKey, signatureBytes, fileToVerify);