blob: 23903e44748221ac388e9163c5b851270aa2bfd0 [file] [log] [blame]
// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHAPS_OBJECT_POLICY_H
#define CHAPS_OBJECT_POLICY_H
#include <string>
#include "pkcs11/cryptoki.h"
namespace chaps {
class Object;
// ObjectPolicy encapsulates policies for a PKCS #11 object.
class ObjectPolicy {
public:
virtual ~ObjectPolicy() {}
virtual void Init(Object* object) = 0;
virtual bool IsReadAllowed(CK_ATTRIBUTE_TYPE type) = 0;
virtual bool IsModifyAllowed(CK_ATTRIBUTE_TYPE type,
const std::string& value) = 0;
virtual bool IsObjectComplete() = 0;
virtual void SetDefaultAttributes() = 0;
};
} // namespace
#endif // CHAPS_OBJECT_POLICY_H