X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/b04fe171f0375ecd5d8a24747ca1dff85720a0ca..6b200bc335dc93c5516ccb52f14bd896d8c7fad7:/SecurityTests/clxutils/ocspTool/ocspUtils.cpp diff --git a/SecurityTests/clxutils/ocspTool/ocspUtils.cpp b/SecurityTests/clxutils/ocspTool/ocspUtils.cpp deleted file mode 100644 index 5084806c..00000000 --- a/SecurityTests/clxutils/ocspTool/ocspUtils.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include -#include -#include "ocspUtils.h" -#include -#include -#include - - -/* - * Sign some data with an identity. - */ -OSStatus ocspSign( - SecIdentityRef idRef, - CSSM_DATA &plainText, - CSSM_ALGORITHMS algId, // RSA/SHA1, DSA/SHA1 - CSSM_DATA &sig) // caller must APP_FREE() -{ - const CSSM_KEY *privCssmKey; - OSStatus ortn; - SecKeyRef privKeyRef; - CSSM_CSP_HANDLE cspHand; - CSSM_RETURN crtn; - - ortn = SecIdentityCopyPrivateKey(idRef, &privKeyRef); - if(ortn) { - cssmPerror("SecIdentityCopyPrivateKey", ortn); - return ortn; - } - ortn = SecKeyGetCSSMKey(privKeyRef, &privCssmKey); - if(ortn) { - cssmPerror("SecKeyGetCSSMKey", ortn); - goto errOut; - } - ortn = SecKeyGetCSPHandle(privKeyRef, &cspHand); - if(ortn) { - cssmPerror("SecKeyGetCSPHandle", ortn); - goto errOut; - } - sig.Data = NULL; - sig.Length = 0; - crtn = cspSign(cspHand, algId, (CSSM_KEY_PTR)privCssmKey, - &plainText, &sig); - if(crtn) { - cssmPerror("cspSign", crtn); - ortn = crtn; - } -errOut: - CFRelease(privKeyRef); - return ortn; -}