12a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Copyright (c) 2013 The Chromium Authors. All rights reserved.
22a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
32a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// found in the LICENSE file.
42a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
52a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#ifndef NET_ANDROID_CERT_VERIFY_RESULT_ANDROID_H_
62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#define NET_ANDROID_CERT_VERIFY_RESULT_ANDROID_H_
72a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include <jni.h>
95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include <string>
115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include <vector>
125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/basictypes.h"
142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace net {
162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace android {
182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)enum CertVerifyStatusAndroid {
205d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#define CERT_VERIFY_STATUS_ANDROID(label, value) VERIFY_ ## label = value,
215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "net/android/cert_verify_status_android_list.h"
225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#undef CERT_VERIFY_STATUS_ANDROID
232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)};
242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Extract parameters out of an AndroidCertVerifyResult object.
265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)void ExtractCertVerifyResult(jobject result,
275d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                             CertVerifyStatusAndroid* status,
285d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                             bool* is_issued_by_known_root,
295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                             std::vector<std::string>* verified_chain);
305d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
315d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Register JNI methods.
325d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)bool RegisterCertVerifyResult(JNIEnv* env);
335d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}  // namespace android
352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}  // namespace net
372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif  // NET_ANDROID_CERT_VERIFY_RESULT_ANDROID_H_
39