blob: 403b6f4832c54862950c1cb6ae36b4be8d630c89 [file] [log] [blame]
Lutz Justen09cd1c32019-02-15 14:31:49 +01001// Copyright 2019 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef KERBEROS_KRB5_INTERFACE_H_
6#define KERBEROS_KRB5_INTERFACE_H_
7
8#include <string>
9
10#include <base/compiler_specific.h>
11
12#include "kerberos/proto_bindings/kerberos_service.pb.h"
13
Lutz Justenb79da832019-03-08 14:52:53 +010014namespace base {
15class FilePath;
16}
17
Lutz Justen09cd1c32019-02-15 14:31:49 +010018namespace kerberos {
19
20class Krb5Interface {
21 public:
22 Krb5Interface();
23 ~Krb5Interface();
24
25 // Gets a Kerberos ticket-granting-ticket for the given |principal_name|
26 // (user@REALM.COM). |password| is the password for the Kerberos account.
27 // |krb5cc_path| is the file path where the Kerberos credential cache (i.e.
28 // the TGT) is written to. |krb5conf_path| is the path to a Kerberos
29 // configuration file (krb5.conf).
30 ErrorType AcquireTgt(const std::string& principal_name,
31 const std::string& password,
Lutz Justenb79da832019-03-08 14:52:53 +010032 const base::FilePath& krb5cc_path,
33 const base::FilePath& krb5conf_path) WARN_UNUSED_RESULT;
Lutz Justen09cd1c32019-02-15 14:31:49 +010034
35 // Renews an existing Kerberos ticket-granting-ticketfor the given
36 // |principal_name| (user@REALM.COM). |krb5cc_path| is the file path of the
37 // Kerberos credential cache. |krb5conf_path| is the path to a Kerberos
38 // configuration file (krb5.conf).
39 ErrorType RenewTgt(const std::string& principal_name,
Lutz Justenb79da832019-03-08 14:52:53 +010040 const base::FilePath& krb5cc_path,
41 const base::FilePath& krb5conf_path) WARN_UNUSED_RESULT;
Lutz Justen09cd1c32019-02-15 14:31:49 +010042};
43
44} // namespace kerberos
45
46#endif // KERBEROS_KRB5_INTERFACE_H_