Skip to content

Instantly share code, notes, and snippets.

@fardeen9983
Last active April 15, 2022 20:56
Show Gist options
  • Save fardeen9983/74eaf4cb0a40f6ae92046ff4ff4ccba2 to your computer and use it in GitHub Desktop.
Save fardeen9983/74eaf4cb0a40f6ae92046ff4ff4ccba2 to your computer and use it in GitHub Desktop.
CloudFront Signed URL Generation
private string GetPrivateUrl(string file)
{
try
{
return
AmazonCloudFrontUrlSigner.GetCannedSignedURL(
"https://" + CloudFrontDomain + "/" + file,
new StreamReader(@"PrivateKey.pem"),
CloudFrontKeyId,
DateTime.Now.AddDays(7)
);
}
catch (Exception)
{
throw;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment