Cloudfront.signCloudfrontUrl()

Sign an Amazon CloudFront URL.

Usage

Hover over inputs/exits for more info.

var Cloudfront = require('machinepack-cloudfront');


// Sign an Amazon CloudFront URL.

Cloudfront.signCloudfrontUrl({

keypairId: 'APKAJU5MWXIKYDV3YILQ',

privateKey: '-----BEGIN RSA PRIVATE KEY-----\nMIIEow......\n-----END RSA PRIVATE KEY-----',

src: 'http://cloudfront.net/path/to/thing.jpg',

ttl: 3600,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

keypairId required

Your CloudFront keypair id (i.e. "Access Key ID")

'APKAJU5MWXIKYDV3YILQ'
privateKey required

Your CloudFront private key

'-----BEGIN RSA PRIVATE KEY-----\nMIIEow......\n-----END RSA PRIVATE KEY-----'
src required

The CloudFront URL to sign

'http://cloudfront.net/path/to/thing.jpg'
ttl

Number of miliseconds to cache the contents of the src URL on CloudFront

3600

Exits

error

An unexpected error occurred.

success

OK.

'http://cloudfront.com/blah/blah'