We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
22.12.0
10.9.0
root:xnu-10063.101.17~1/RELEASE_ARM64_T8112 arm64
buffer
async getSignedURL(filePath: string) { try { const privateKey = fs.readFileSync('private-key.pem', { encoding: 'utf8' });//.replace(/\n/g, '\n'); console.log("privateKey", privateKey);
const url = `https://${cdn_domain}.d1a3sb2t664pk3.cloudfront.net/${filePath}`; const keyPairId = this.cloudFrontKeyPairId; const dateLessThan = Math.floor((Date.now() + 60 * 60 * 1000) / 1000); const policy = { Statement: [ { Resource: url, Condition: { DateLessThan: { "AWS:EpochTime": new Date(dateLessThan).getTime() / 1000, }, }, }, ], }; const signedUrl = await getSignedUrl({ url: url, privateKey: privateKey, keyPairId: keyPairId, policy: JSON.stringify(policy), }); console.log("Signed URL:", signedUrl); return signedUrl; } catch (error) { console.error("Error generating CloudFront signed URL:", error); throw error; }
}
No response
privateKey -----BEGIN PRIVATE KEY-----djfnhjidnfefjnijfnhienhgvijufnvjlk-----END PRIVATE KEY----- Error generating CloudFront signed URL: Error: error:1E08010C:DECODER routines::unsupported at Sign.sign (node:internal/crypto/sig:128:29)
[error] error:1E08010C:DECODER routines::unsupported. METADATA: {"metadata":{"stack":"Error: error:1E08010C:DECODER routines::unsupported\n at Sign.sign (node:internal/crypto/sig:128:29)\n at _CloudfrontSignBuilder.signData
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Node.js Version
22.12.0
NPM Version
10.9.0
Operating System
root:xnu-10063.101.17~1/RELEASE_ARM64_T8112 arm64
Subsystem
buffer
Description
async getSignedURL(filePath: string) {
try {
const privateKey = fs.readFileSync('private-key.pem', { encoding: 'utf8' });//.replace(/\n/g, '\n');
console.log("privateKey", privateKey);
}
Minimal Reproduction
No response
Output
privateKey -----BEGIN PRIVATE KEY-----djfnhjidnfefjnijfnhienhgvijufnvjlk-----END PRIVATE KEY-----
Error generating CloudFront signed URL: Error: error:1E08010C:DECODER routines::unsupported
at Sign.sign (node:internal/crypto/sig:128:29)
[error] error:1E08010C:DECODER routines::unsupported. METADATA: {"metadata":{"stack":"Error: error:1E08010C:DECODER routines::unsupported\n at Sign.sign (node:internal/crypto/sig:128:29)\n at _CloudfrontSignBuilder.signData
Before You Submit
The text was updated successfully, but these errors were encountered: