-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
44 lines (36 loc) · 1.6 KB
/
Copy pathProgram.cs
File metadata and controls
44 lines (36 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.IO;
using System.Security.Cryptography;
using System.Xml;
using System.Collections.Generic;
using System.Text;
using Amazon.CloudFront;
namespace CloudfrontSignedUrl
{
class Program
{
static void Main(string[] args)
{
var protocol = AmazonCloudFrontUrlSigner.Protocol.https;
var distributionDomain = "d1w1uj9kqe1ebe.cloudfront.net";
var resourcePath = "narutoperfil.jpg";
var keyPairId = "K2FBX61W5Y2MOL";
var expiresOn = DateTime.Now.AddSeconds(45);
var ipRange = "2804:1b3:a200:9dc7:cfc:d226:d38:7dff";
// using (StreamReader reader = File.OpenText(System.IO.Path.GetFullPath("cloudfront-test-key.pem")))
// {
// var text = AmazonCloudFrontUrlSigner.GetCannedSignedURL(protocol, distributionDomain, reader, resourcePath, keyPairId, expiresOn);
// Console.WriteLine("CannedSignedURL");
// Console.WriteLine(text);
// Console.WriteLine("----------------------------------");
// }
using (StreamReader reader = File.OpenText(System.IO.Path.GetFullPath("cloudfront-test-key.pem")))
{
var text = AmazonCloudFrontUrlSigner.GetCustomSignedURL(protocol,distributionDomain, reader, resourcePath, keyPairId, expiresOn, ipRange);
Console.WriteLine("CustomSignedURL");
Console.WriteLine(text);
Console.WriteLine("----------------------------------");
}
}
}
}