diff dstep/security/SecKey.d @ 11:07194b026fa4

Added bindings to a couple of frameworks, new license + some other things
author Jacob Carlborg <doob@me.com>
date Sat, 01 Aug 2009 15:03:28 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/security/SecKey.d	Sat Aug 01 15:03:28 2009 +0200
@@ -0,0 +1,60 @@
+/**
+ * Copyright: Copyright (c) 2009 Jacob Carlborg.
+ * Authors: Jacob Carlborg
+ * Version: Initial created: Jul 22, 2009 
+ * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
+ */
+module dstep.security.SecKey;
+
+import dstep.security.SecBase;
+import dstep.security.cssmtype;
+
+alias uint SecCredentialType;
+
+enum
+{
+	kSecKeyKeyClass = 0,
+	kSecKeyPrintName = 1,
+	kSecKeyAlias = 2,
+	kSecKeyPermanent = 3,
+	kSecKeyPrivate = 4,
+	kSecKeyModifiable = 5,
+	kSecKeyLabel = 6,
+	kSecKeyApplicationTag = 7,
+	kSecKeyKeyCreator = 8,
+	kSecKeyKeyType = 9,
+	kSecKeyKeySizeInBits = 10,
+	kSecKeyEffectiveKeySize = 11,
+	kSecKeyStartDate = 12,
+	kSecKeyEndDate = 13,
+	kSecKeySensitive = 14,
+	kSecKeyAlwaysSensitive = 15,
+	kSecKeyExtractable = 16,
+	kSecKeyNeverExtractable = 17,
+	kSecKeyEncrypt = 18,
+	kSecKeyDecrypt = 19,
+	kSecKeyDerive = 20,
+	kSecKeySign = 21,
+	kSecKeyVerify = 22,
+	kSecKeySignRecover = 23,
+	kSecKeyVerifyRecover = 24,
+	kSecKeyWrap = 25,
+	kSecKeyUnwrap = 26
+}
+
+enum
+{
+	kSecCredentialTypeDefault = 0,
+	kSecCredentialTypeWithUI,
+	kSecCredentialTypeNoUI
+}
+
+extern (C)
+{
+	uint SecKeyGetTypeID ();
+	int SecKeyCreatePair (SecKeychainRef keychainRef, uint algorithm, uint keySizeInBits, ulong contextHandle, uint publicKeyUsage, uint publicKeyAttr, uint privateKeyUsage, uint privateKeyAttr, SecAccessRef initialAccess, SecKeyRef* publicKey, SecKeyRef* privateKey);
+	int SecKeyGenerate (SecKeychainRef keychainRef, uint algorithm, uint keySizeInBits, ulong contextHandle, uint keyUsage, uint keyAttr, SecAccessRef initialAccess, SecKeyRef* keyRef);
+	int SecKeyGetCSSMKey (SecKeyRef key, CSSM_KEY** cssmKey);
+	int SecKeyGetCSPHandle (SecKeyRef keyRef, CSSM_CSP_HANDLE* cspHandle);
+	int SecKeyGetCredentials (SecKeyRef keyRef, int operation, uint credentialType, CSSM_ACCESS_CREDENTIALS** outCredentials);
+}
\ No newline at end of file