]> git.saurik.com Git - apple/libsecurity_codesigning.git/blobdiff - lib/resources.h
libsecurity_codesigning-55037.15.tar.gz
[apple/libsecurity_codesigning.git] / lib / resources.h
index 7c6ca1c70f779751fcedfde8f9a1787b340aca47..69c5851b6cb286b1d03b4565190f1eb8bfc4ba1f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006 Apple Computer, Inc. All Rights Reserved.
+ * Copyright (c) 2006-2010 Apple Inc. All Rights Reserved.
  * 
  * @APPLE_LICENSE_HEADER_START@
  * 
@@ -28,6 +28,7 @@
 #define _H_RSIGN
 
 #include "renum.h"
+#include "codedirectory.h"
 #include <security_utilities/utilities.h>
 #include <security_utilities/cfutilities.h>
 #include <security_utilities/hashing.h>
@@ -47,7 +48,7 @@ namespace CodeSigning {
 //
 class ResourceBuilder : public ResourceEnumerator {
 public:
-       ResourceBuilder(const std::string &root, CFDictionaryRef rules);
+       ResourceBuilder(const std::string &root, CFDictionaryRef rules, CodeDirectory::HashAlgorithm hashType);
        ~ResourceBuilder();
 
        CFDictionaryRef build();
@@ -81,11 +82,13 @@ public:
 protected:
        void addRule(CFTypeRef key, CFTypeRef value);
        CFDataRef hashFile(const char *path);
+       DynamicHash *getHash() const { return CodeDirectory::hashFor(this->mHashType); }
        
 private:
        CFCopyRef<CFDictionaryRef> mRawRules;
        typedef std::vector<Rule *> Rules;
        Rules mRules;
+       CodeDirectory::HashAlgorithm mHashType;
 };