 
 public class JWTNaCl: JWT {
 
+    public func _kid(key: NSData) -> String {
+        return key.base64SafeUrlEncode()
+    }
+
     override func implemented(algorithm: String?) -> Bool {
         let algorithms = ["Ed25519"]
         for alg in algorithms {

        }
    }

    public func loads(jwt: String, key: NSData? = nil, verify: Bool = true, error: NSErrorPointer = nil) -> Bool {
        // load a JWT string into this object
        var sig = ""
        var hdr: [String: AnyObject]?

// MARK: - base64 extensions

extension String {
    func base64SafeUrlDecode() -> NSData { // TODO : add ! or ?
        return self.base64SafeUrlDecode(nil)
    }
    
    func base64SafeUrlDecode(options: NSDataBase64DecodingOptions) -> NSData! { // TODO: better use ? instead of ! ??
        var s: String = self;
        
        s = s.stringByReplacingOccurrencesOfString("-", withString: "+") // 62nd char of encoding
