public OpenWOPIWebClient(string url, string access_token, string access_token_ttl, OpenWOPIProofKey proofKey) { _access_token = access_token; _access_token_ttl = access_token_ttl; _utc = DateTime.UtcNow; _proofkey = proofKey; }
public static void SaveToConfiguration(OpenWOPIProofKey key, string source) { string[] lines = new string[] { "proof:" + key.Proof, "proof-key:" + key.ProofWithKey, "old-proof:" + key.OldProof, "old-proof-key:" + key.OldProofWithKey }; System.IO.File.WriteAllLines(source, lines); }
public static OpenWOPIProofKey ReadFromConfiguration(OpenWOPIConfiguration configuration) { OpenWOPIProofKey key = new OpenWOPIProofKey(); key.Proof = configuration["proof"]; key.ProofWithKey = configuration["proof-key"]; key.OldProof = configuration["old-proof"]; key.OldProofWithKey = configuration["old-proof-key"]; return(key); }
public static OpenWOPIProofKey GenerateNew(OpenWOPIProofKey oldKey) { using (RSACryptoServiceProvider serviceProvider = new RSACryptoServiceProvider(KeyLength)) { OpenWOPIProofKey newKey = new OpenWOPIProofKey(); newKey.OldProof = oldKey.Proof; newKey.OldProofWithKey = oldKey.ProofWithKey; newKey.Proof = System.Convert.ToBase64String(serviceProvider.ExportCspBlob(false)); newKey.ProofWithKey = System.Convert.ToBase64String(serviceProvider.ExportCspBlob(true)); return(newKey); } }
public OpenWOPITextDocument(string source, OpenWOPIAccessToken accessToken, OpenWOPIProofKey proofKey) : base(source, accessToken, proofKey) { DocumentEncoding = Encoding.UTF8; }
public OpenWOPIDocument(string source, OpenWOPIAccessToken accessToken, OpenWOPIProofKey proofKey) : this() { AccessToken = accessToken; Source = source; ProofKey = proofKey; }