1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2004-2009 Sage Weil <sage@newdream.net>
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #ifndef CEPH_ROTATINGKEYRING_H
16 #define CEPH_ROTATINGKEYRING_H
18 #include "common/Mutex.h"
19 #include "auth/Auth.h"
22 * mediate access to a service's keyring and rotating secrets
28 class RotatingKeyRing : public KeyStore {
31 RotatingSecrets secrets;
36 RotatingKeyRing(CephContext *cct_, uint32_t s, KeyRing *kr) :
40 lock("RotatingKeyRing::lock") {}
42 bool need_new_secrets() const;
43 bool need_new_secrets(utime_t now) const;
44 void set_secrets(RotatingSecrets&& s);
45 void dump_rotating() const;
46 bool get_secret(const EntityName& name, CryptoKey& secret) const override;
47 bool get_service_secret(uint32_t service_id, uint64_t secret_id,
48 CryptoKey& secret) const override;
49 KeyRing *get_keyring();