Last active
April 15, 2022 20:56
-
-
Save fardeen9983/74eaf4cb0a40f6ae92046ff4ff4ccba2 to your computer and use it in GitHub Desktop.
CloudFront Signed URL Generation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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