         return PersistentToken(token: token, identifier: persistentRef)
     }
 
+    /// Updates the given persistent token with a new token value.
+    ///
+    /// - parameter persistentToken: The persistent token to update.
+    /// - parameter token: The new token value.
+    ///
+    /// - returns: The updated persistent token, or `nil` if an error has occured.
     public func updatePersistentToken(persistentToken: PersistentToken,
         withToken token: Token) -> PersistentToken?
     {


import Foundation

public final class Keychain {
    public static let sharedInstance = Keychain()

    public func persistentTokenWithIdentifier(identifier: NSData) -> PersistentToken? {
        guard let result = keychainItemForPersistentRef(identifier) else {
            return nil

        return PersistentToken(keychainDictionary: result)
    }

    /// Returns an array of all persistent tokens found in the keychain.
    public func allPersistentTokens() -> [PersistentToken]? {
        guard let keychainItems = allKeychainItems() as? [NSDictionary] else {
            return nil
