Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 13x 13x 13x 13x 7x | import { createHmacSigner } from './internal/storage-encoding'
export class StorageSharedKeyCredential {
public readonly accountName: string
private readonly sign: (text: string) => Promise<string>
public constructor(accountName: string, accountKey: string) {
Iif (accountName.length === 0) {
throw new TypeError('accountName is required')
}
Iif (accountKey.length === 0) {
throw new TypeError('accountKey is required')
}
this.accountName = accountName
this.sign = createHmacSigner(accountKey)
}
public async computeHMACSHA256(stringToSign: string): Promise<string> {
return await this.sign(stringToSign)
}
}
|