Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hmac-sign/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export async function execute(context: Context): Promise<Output> {
}

async function signContent(context: Context, contentBytes: SecureByteArray): Promise<ArrayBuffer> {
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);
Expand Down
4 changes: 2 additions & 2 deletions hmac-verify/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export async function execute(context: Context): Promise<Output> {
}

async function verifyContent(context: Context, signatureBytes: Uint8Array, contentBytes: SecureByteArray): Promise<boolean> {
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);
Expand Down
4 changes: 2 additions & 2 deletions multiple-resource-copy/index.ts
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down Expand Up @@ -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<Output | void> {
Expand Down
4 changes: 2 additions & 2 deletions resource-copy/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function getDescription(): ScriptDescription {
export function getDescription() {
return {
displayName: "Resource Copy",
description: "Copies an input resource into an output resource.",
Expand Down Expand Up @@ -33,7 +33,7 @@ export function getDescription(): ScriptDescription {
},
],
output: [],
};
} as const satisfies ScriptDescription;
}

export async function execute(context: Context): Promise<Output | void> {
Expand Down
4 changes: 2 additions & 2 deletions rsa-sign/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export async function execute(context: Context): Promise<Output> {
}

async function signContent(context: Context, fileToSign: IFile): Promise<ArrayBuffer> {
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);
Expand Down
4 changes: 2 additions & 2 deletions rsa-verify/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ export async function execute(context: Context): Promise<Output> {
}

async function verifyContent(context: Context, signatureBytes: Uint8Array, fileToVerify: IFile): Promise<boolean> {
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);
Expand Down