派生 AWS Signature V4 签名密钥
( secretKey: string, dateStamp: string, region: string, service: string )
| 42 | |
| 43 | /** 派生 AWS Signature V4 签名密钥 */ |
| 44 | async function deriveSigningKey( |
| 45 | secretKey: string, |
| 46 | dateStamp: string, |
| 47 | region: string, |
| 48 | service: string |
| 49 | ): Promise<ArrayBuffer> { |
| 50 | const kDate = await hmacSha256(new TextEncoder().encode(`AWS4${secretKey}`).buffer as ArrayBuffer, dateStamp); |
| 51 | const kRegion = await hmacSha256(kDate, region); |
| 52 | const kService = await hmacSha256(kRegion, service); |
| 53 | return hmacSha256(kService, "aws4_request"); |
| 54 | } |
| 55 | |
| 56 | // ---- URI 编码 ---- |
| 57 |
no test coverage detected