 
 class OTPToken: NSObject {
     var token: Token
+    var keychainItem: Token.KeychainItem?
 
     @required init(token: Token) {
         self.token = token

    }

    var url: NSURL { return token.url }

    // Persistence

    var keychainItem: Token.KeychainItem?
    var keychainItemRef: NSData? {return self.keychainItem?.keychainItemRef }
    var isInKeychain: Bool { return (keychainItemRef != nil) }



    func validate() -> Bool { return token.isValid }
    override var description: String { return token.description }
}

extension OTPToken {
    func password() -> String? { return token.password() }
    func updatePassword() { token = token.updatedToken() }

    func generatePasswordForCounter(counter: UInt64) -> String? {
        return token.passwordForCounter(counter)
    }
}

extension OTPToken {
    class func tokenWithURL(url: NSURL) -> OTPToken? {
        if let token = Token.tokenWithURL(url) {
            return OTPToken(token: token)
