public static TerodoViewOAuth2Token ApplyCryptor(this TerodoViewOAuth2Token toEncrypt, Func <string, string> cryptor) { Invariant.ArgumentNotNull((object)toEncrypt, "toEncrypt"); Invariant.ArgumentNotNull((object)cryptor, "cryptor"); return(new TerodoViewOAuth2Token() { token = cryptor(toEncrypt.token), tokenuid = toEncrypt.tokenuid, tokenclient = toEncrypt.tokenclient, tokentype = toEncrypt.tokentype, tokenexpiry = toEncrypt.tokenexpiry }); }
public static TerodoViewOAuth2Token EncryptUserScope(this TerodoViewOAuth2Token toEncrypt) { return(toEncrypt.ApplyCryptor(new Func <string, string>(Cryptor.Encrypt))); }
public static TerodoViewOAuth2Token DecryptTripleDES(this TerodoViewOAuth2Token toDecrypt) { return(toDecrypt.ApplyCryptor(new Func <string, string>(Cryptor.DecryptTripleDES))); }
public static TerodoViewOAuth2Token DecryptMachineScope(this TerodoViewOAuth2Token toDecrypt) { return(toDecrypt.ApplyCryptor(new Func <string, string>(Cryptor.DecryptMachineScope))); }
public TerodoViewOAuth2Token Encrypt(TerodoViewOAuth2Token plain) { return(plain.EncryptTripleDES()); }
public TerodoViewOAuth2Token Decrypt(TerodoViewOAuth2Token cipher) { return(cipher.DecryptTripleDES()); }