 
     func implemented(algorithm: String?) -> Bool {
         let algorithms = ["none", "HS256", "HS384", "HS512"]
-        // TODO: add RS256, RS384, RS512 when rsa_* methods below are done
+        // TODO: add RS256, RS384, RS512, PS256, PS384, PS512 when rsa_* methods below are done
         for alg in algorithms {
             if alg == algorithm {
                 return true

        case "RS256": return msg.rsa_verify(HMACAlgorithm.SHA256, signature: signature, key: key!)
        case "RS384": return msg.rsa_verify(HMACAlgorithm.SHA384, signature: signature, key: key!)
        case "RS512": return msg.rsa_verify(HMACAlgorithm.SHA512, signature: signature, key: key!)
        // TODO: support for RSASSA-PSS algorithms: "PS256", "PS384", and "PS512"
        default:      return false
        }
    }

    }

    func nacl_signature(key: NSData) -> String! {
        // key is privkey
        let sodium = Sodium()
        if let sig = sodium?.sign.signature(self, secretKey: key) {
            return sig.base64SafeUrlEncode()
