Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

soffes/Camo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Camo

Version Swift Version Carthage compatible

Swift client for Camo.

Camo depends on Crypto. Released under the MIT license.

Installation

Carthage is the recommended way to install Crypto. Add the following to your Cartfile:

github "soffes/Camo"

Usage

import Camo

// Setup Camo with your secret and base URL.
// You can also optionally set the HMAC algorithm. The default is SHA1
let camo = Camo(secret: "something-secret", baseURL: NSURL(string: "https://camo.example.com/")!)

// Get a URL to sign
let imageURL = NSURL(string: "http://soffes-assets.s3.amazonaws.com/images/Sam-Soffes.jpg")!

// Get a camo'd URL
camo.sign(URL: URL) // "https://camo.example.com/c426621ed24dd05c47d766e5372de822c5601789?url=http://soffes-assets.s3.amazonaws.com/images/Sam-Soffes.jpg"