Function cloudfront_sign::get_signed_url [−][src]
pub fn get_signed_url(
url: &str,
options: &SignedOptions
) -> Result<String, EncodingError>
Get a CloudFront signed URL
Arguments
url
- A CloudFront URL for which the URL is generated. Can be a wildcard, e.g.https://some-cf-url.cloudfront.net/key/*
Examples
use std::fs; use cloudfront_sign::*; let private_key = fs::read_to_string("tests/data/private_key.pem").unwrap(); let options = SignedOptions { key_pair_id: String::from("SOMEKEYPAIRID"), private_key: private_key, ..Default::default() }; let signed_url = get_signed_url("https://example.com", &options).unwrap();