SecTrustedApplication.cpp [plain text]
#include <Security/SecTrustedApplication.h>
#include "SecBridge.h"
CFTypeID
SecTrustedApplicationGetTypeID(void)
{
BEGIN_SECAPI
return gTypes().trustedApplication.typeId;
END_SECAPI1(_kCFRuntimeNotATypeID)
}
OSStatus
SecTrustedApplicationCreateFromPath(const char *path, SecTrustedApplicationRef *appRef)
{
BEGIN_SECAPI
RefPointer<TrustedApplication> app =
path ? new TrustedApplication(path) : new TrustedApplication;
Required(appRef) = gTypes().trustedApplication.handle(*app);
END_SECAPI
}
OSStatus SecTrustedApplicationCopyData(SecTrustedApplicationRef appRef,
CFDataRef *dataRef)
{
BEGIN_SECAPI
const CssmData &data = gTypes().trustedApplication.required(appRef)->data();
Required(dataRef) = CFDataCreate(NULL, (const UInt8 *)data.data(), data.length());
END_SECAPI
}
OSStatus SecTrustedApplicationSetData(SecTrustedApplicationRef appRef,
CFDataRef dataRef)
{
BEGIN_SECAPI
gTypes().trustedApplication.required(appRef)->data(cfData(dataRef));
END_SECAPI
}