Amazon.CloudFront.AmazonCloudFrontCookieSigner.GetCookiesForCannedPolicy C# (CSharp) Method

GetCookiesForCannedPolicy() public static method

Returns signed cookies that grants universal access to private content until a given date.
public static GetCookiesForCannedPolicy ( Protocols protocol, string distributionDomain, FileSystemInfo privateKey, string resourcePath, string keyPairId, System.DateTime expiresOn ) : CookiesForCannedPolicy
protocol Protocols The protocol used to access content using signed cookies.
distributionDomain string The domain name of the distribution.
privateKey System.IO.FileSystemInfo The private key file. RSA private key (.pem) are supported.
resourcePath string The path for the resource.
keyPairId string The key pair id corresponding to the private key file given.
expiresOn System.DateTime The expiration date till which content can be accessed using the generated cookies.
return CookiesForCannedPolicy
        public static CookiesForCannedPolicy GetCookiesForCannedPolicy(Protocols protocol,
                                                string distributionDomain,
                                                FileSystemInfo privateKey,
                                                string resourcePath,
                                                string keyPairId,
                                                DateTime expiresOn)
        {
            using (var reader = new StreamReader(File.OpenRead(privateKey.FullName)))
            {
                return GetCookiesForCannedPolicy(protocol, distributionDomain, reader, resourcePath, keyPairId, expiresOn);
            }
        }

Same methods

AmazonCloudFrontCookieSigner::GetCookiesForCannedPolicy ( Protocols protocol, string distributionDomain, TextReader privateKey, string resourcePath, string keyPairId, System.DateTime expiresOn ) : CookiesForCannedPolicy
AmazonCloudFrontCookieSigner::GetCookiesForCannedPolicy ( string resourceUrlOrPath, string keyPairId, FileSystemInfo privateKey, System.DateTime expiresOn ) : CookiesForCannedPolicy
AmazonCloudFrontCookieSigner::GetCookiesForCannedPolicy ( string resourceUrlOrPath, string keyPairId, TextReader privateKey, System.DateTime expiresOn ) : CookiesForCannedPolicy