Lines Matching refs:cert

44 static void LoadKeyFromFile(const std::string& file_name, Certificate* cert) {  in LoadKeyFromFile()  argument
48 std::vector<uint8_t>(testkey_string.begin(), testkey_string.end()), cert)); in LoadKeyFromFile()
69 static void VerifyPackageWithSingleCertificate(const std::string& name, Certificate&& cert) { in VerifyPackageWithSingleCertificate() argument
71 certs.emplace_back(std::move(cert)); in VerifyPackageWithSingleCertificate()
98 Certificate cert(0, Certificate::KEY_TYPE_RSA, nullptr, nullptr); in TEST() local
103 std::vector<uint8_t>(testkey_string.begin(), testkey_string.end()), &cert)); in TEST()
107 Certificate cert(0, Certificate::KEY_TYPE_RSA, nullptr, nullptr); in TEST() local
108 LoadKeyFromFile(from_testdata_base("testkey_v1.x509.pem"), &cert); in TEST()
110 ASSERT_EQ(SHA_DIGEST_LENGTH, cert.hash_len); in TEST()
111 ASSERT_EQ(Certificate::KEY_TYPE_RSA, cert.key_type); in TEST()
112 ASSERT_EQ(nullptr, cert.ec); in TEST()
114 VerifyPackageWithSingleCertificate("otasigned_v1.zip", std::move(cert)); in TEST()
118 Certificate cert(0, Certificate::KEY_TYPE_RSA, nullptr, nullptr); in TEST() local
119 LoadKeyFromFile(from_testdata_base("testkey_v2.x509.pem"), &cert); in TEST()
121 ASSERT_EQ(SHA_DIGEST_LENGTH, cert.hash_len); in TEST()
122 ASSERT_EQ(Certificate::KEY_TYPE_RSA, cert.key_type); in TEST()
123 ASSERT_EQ(nullptr, cert.ec); in TEST()
125 VerifyPackageWithSingleCertificate("otasigned_v2.zip", std::move(cert)); in TEST()
129 Certificate cert(0, Certificate::KEY_TYPE_RSA, nullptr, nullptr); in TEST() local
130 LoadKeyFromFile(from_testdata_base("testkey_v3.x509.pem"), &cert); in TEST()
132 ASSERT_EQ(SHA256_DIGEST_LENGTH, cert.hash_len); in TEST()
133 ASSERT_EQ(Certificate::KEY_TYPE_RSA, cert.key_type); in TEST()
134 ASSERT_EQ(nullptr, cert.ec); in TEST()
136 VerifyPackageWithSingleCertificate("otasigned_v3.zip", std::move(cert)); in TEST()
140 Certificate cert(0, Certificate::KEY_TYPE_RSA, nullptr, nullptr); in TEST() local
141 LoadKeyFromFile(from_testdata_base("testkey_v4.x509.pem"), &cert); in TEST()
143 ASSERT_EQ(SHA256_DIGEST_LENGTH, cert.hash_len); in TEST()
144 ASSERT_EQ(Certificate::KEY_TYPE_RSA, cert.key_type); in TEST()
145 ASSERT_EQ(nullptr, cert.ec); in TEST()
147 VerifyPackageWithSingleCertificate("otasigned_v4.zip", std::move(cert)); in TEST()
151 Certificate cert(0, Certificate::KEY_TYPE_RSA, nullptr, nullptr); in TEST() local
152 LoadKeyFromFile(from_testdata_base("testkey_v5.x509.pem"), &cert); in TEST()
154 ASSERT_EQ(SHA256_DIGEST_LENGTH, cert.hash_len); in TEST()
155 ASSERT_EQ(Certificate::KEY_TYPE_EC, cert.key_type); in TEST()
156 ASSERT_EQ(nullptr, cert.rsa); in TEST()
158 VerifyPackageWithSingleCertificate("otasigned_v5.zip", std::move(cert)); in TEST()
162 Certificate cert(0, Certificate::KEY_TYPE_RSA, nullptr, nullptr); in TEST() local
163 LoadKeyFromFile(from_testdata_base("testkey_4096bits.x509.pem"), &cert); in TEST()
165 ASSERT_EQ(SHA256_DIGEST_LENGTH, cert.hash_len); in TEST()
166 ASSERT_EQ(Certificate::KEY_TYPE_RSA, cert.key_type); in TEST()
167 ASSERT_EQ(nullptr, cert.ec); in TEST()
169 VerifyPackageWithSingleCertificate("otasigned_4096bits.zip", std::move(cert)); in TEST()