Lines Matching defs:cryptographer
5 #include "chrome/browser/sync/util/cryptographer.h"
18 Cryptographer cryptographer;
19 EXPECT_FALSE(cryptographer.is_ready());
25 EXPECT_FALSE(cryptographer.CanDecrypt(encrypted));
29 Cryptographer cryptographer;
32 cryptographer.AddKey(params);
33 EXPECT_TRUE(cryptographer.is_ready());
39 EXPECT_FALSE(cryptographer.CanDecrypt(encrypted));
43 Cryptographer cryptographer;
46 EXPECT_TRUE(cryptographer.AddKey(params));
47 EXPECT_TRUE(cryptographer.is_ready());
55 EXPECT_TRUE(cryptographer.Encrypt(original, &encrypted));
58 EXPECT_TRUE(cryptographer.Decrypt(encrypted, &decrypted));
64 Cryptographer cryptographer;
67 EXPECT_TRUE(cryptographer.AddKey(params1));
68 EXPECT_TRUE(cryptographer.is_ready());
76 EXPECT_TRUE(cryptographer.Encrypt(original, &encrypted1));
78 EXPECT_TRUE(cryptographer.Encrypt(original, &encrypted2));
81 EXPECT_TRUE(cryptographer.AddKey(params2));
82 EXPECT_TRUE(cryptographer.is_ready());
85 EXPECT_TRUE(cryptographer.Encrypt(original, &encrypted3));
87 EXPECT_TRUE(cryptographer.Encrypt(original, &encrypted4));
110 Cryptographer cryptographer;
113 cryptographer.AddKey(params);
114 EXPECT_TRUE(cryptographer.is_ready());
116 EXPECT_TRUE(cryptographer.Encrypt(original, &encrypted));
117 EXPECT_TRUE(cryptographer.GetKeys(&nigori));
121 Cryptographer cryptographer;
122 EXPECT_FALSE(cryptographer.CanDecrypt(nigori));
124 cryptographer.SetPendingKeys(nigori);
125 EXPECT_FALSE(cryptographer.is_ready());
126 EXPECT_TRUE(cryptographer.has_pending_keys());
129 EXPECT_TRUE(cryptographer.DecryptPendingKeys(params));
130 EXPECT_TRUE(cryptographer.is_ready());
131 EXPECT_FALSE(cryptographer.has_pending_keys());
134 EXPECT_TRUE(cryptographer.Decrypt(encrypted, &decrypted));
156 Cryptographer cryptographer;
158 EXPECT_TRUE(cryptographer.PackBootstrapToken(&nigori, &token));
161 scoped_ptr<Nigori> unpacked(cryptographer.UnpackBootstrapToken(token));