ExtendedAttribute.h [plain text]
#ifndef _SECURITY_EXTENDED_ATTRIBUTE_H_
#define _SECURITY_EXTENDED_ATTRIBUTE_H_
#include <security_keychain/Item.h>
#include <security_cdsa_utilities/cssmdata.h>
typedef struct OpaqueSecExtendedAttributeRef *SecKeychainItemExtendedAttributeRef;
namespace Security
{
namespace KeychainCore
{
class ExtendedAttribute : public ItemImpl
{
NOCOPY(ExtendedAttribute)
public:
SECCFFUNCTIONS(ExtendedAttribute, SecKeychainItemExtendedAttributeRef,
errSecInvalidItemRef, gTypes().ExtendedAttribute)
ExtendedAttribute(CSSM_DB_RECORDTYPE recordType,
const CssmData &itemID,
const CssmData attrName,
const CssmData attrValue);
private:
ExtendedAttribute(const Keychain &keychain,
const PrimaryKey &primaryKey,
const CssmClient::DbUniqueRecord &uniqueId);
ExtendedAttribute(const Keychain &keychain, const PrimaryKey &primaryKey);
public:
static ExtendedAttribute* make(const Keychain &keychain, const PrimaryKey &primaryKey, const CssmClient::DbUniqueRecord &uniqueId);
static ExtendedAttribute* make(const Keychain &keychain, const PrimaryKey &primaryKey);
ExtendedAttribute(ExtendedAttribute &extendedAttribute);
virtual ~ExtendedAttribute() throw();
virtual PrimaryKey add(Keychain &keychain);
bool operator == (const ExtendedAttribute &other) const;
private:
void setupAttrs();
CSSM_DB_RECORDTYPE mRecordType;
CssmAutoData mItemID;
CssmAutoData mAttrName;
CssmAutoData mAttrValue;
};
}
}
#endif