]> git.saurik.com Git - apple/security.git/blobdiff - libsecurity_smime/lib/SecCmsSignerInfo.h
Security-57337.60.2.tar.gz
[apple/security.git] / libsecurity_smime / lib / SecCmsSignerInfo.h
index 26da7167a8add7734cc7a1110f2ae5b9ef7e2f24..19cb5737e65b1fb8cf77da8e608bd86b9cb35f59 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2004 Apple Computer, Inc. All Rights Reserved.
+ *  Copyright (c) 2004,2008,2010,2013 Apple Inc. All Rights Reserved.
  *
  *  @APPLE_LICENSE_HEADER_START@
  *  
@@ -23,7 +23,7 @@
 
 /*!
     @header SecCmsSignerInfo.h
-    @copyright 2004 Apple Computer, Inc. All Rights Reserved.
+    @Copyright (c) 2004,2008,2010,2013 Apple Inc. All Rights Reserved.
 
     @availability 10.4 and later
     @abstract Interfaces of the CMS implementation.
@@ -48,20 +48,13 @@ extern "C" {
     @function
  */
 extern SecCmsSignerInfoRef
-SecCmsSignerInfoCreate(SecCmsMessageRef cmsg, SecIdentityRef identity, SECOidTag digestalgtag);
+SecCmsSignerInfoCreate(SecCmsSignedDataRef sigd, SecIdentityRef identity, SECOidTag digestalgtag);
 
 /*!
     @function
  */
 extern SecCmsSignerInfoRef
-SecCmsSignerInfoCreateWithSubjKeyID(SecCmsMessageRef cmsg, CSSM_DATA_PTR subjKeyID, SecPublicKeyRef pubKey, SecPrivateKeyRef signingKey, SECOidTag digestalgtag);
-
-/*!
-    @function
-    @abstract Destroy a SignerInfo data structure.
- */
-extern void
-SecCmsSignerInfoDestroy(SecCmsSignerInfoRef si);
+SecCmsSignerInfoCreateWithSubjKeyID(SecCmsSignedDataRef sigd, const SecAsn1Item *subjKeyID, SecPublicKeyRef pubKey, SecPrivateKeyRef signingKey, SECOidTag digestalgtag);
 
 /*!
     @function
@@ -69,18 +62,6 @@ SecCmsSignerInfoDestroy(SecCmsSignerInfoRef si);
 extern SecCmsVerificationStatus
 SecCmsSignerInfoGetVerificationStatus(SecCmsSignerInfoRef signerinfo);
 
-/*!
-    @function
- */
-extern OSStatus
-SecCmsSignerInfoVerifyUnAuthAttrs(SecCmsSignerInfoRef signerinfo);
-
-/*!
-    @function
- */
-extern CSSM_DATA *
-SecCmsSignerInfoGetEncDigest(SecCmsSignerInfoRef signerinfo);
-
 /*!
     @function
  */
@@ -99,12 +80,6 @@ SecCmsSignerInfoGetDigestAlgTag(SecCmsSignerInfoRef signerinfo);
 extern CFArrayRef
 SecCmsSignerInfoGetCertList(SecCmsSignerInfoRef signerinfo);
 
-/*!
-    @function
- */
-extern CFArrayRef
-SecCmsSignerInfoGetTimestampCertList(SecCmsSignerInfoRef signerinfo);
-
 /*!
     @function
     @abstract Return the signing time, in UTCTime format, of a CMS signerInfo.
@@ -116,14 +91,14 @@ extern OSStatus
 SecCmsSignerInfoGetSigningTime(SecCmsSignerInfoRef sinfo, CFAbsoluteTime *stime);
 
 /*!
-    @function
-    @abstract Return the timestamp time, in UTCTime format, of a CMS signerInfo.
-    @param sinfo SignerInfo data for this signer.
-    @discussion Returns a pointer to XXXX (what?)
-    @result A return value of NULL is an error.
+     @function
+     @abstract Return the data in the signed Codesigning Hash Agility attribute.
+     @param sinfo SignerInfo data for this signer, pointer to a CFDataRef for attribute value
+     @discussion Returns a CFDataRef containing the value of the attribute
+     @result A return value of SECFailure is an error.
  */
-OSStatus
-SecCmsSignerInfoGetTimestampTime(SecCmsSignerInfoRef sinfo, CFAbsoluteTime *stime);
+extern OSStatus
+SecCmsSignerInfoGetAppleCodesigningHashAgility(SecCmsSignerInfoRef sinfo, CFDataRef *sdata);
 
 /*!
     @function
@@ -140,7 +115,7 @@ SecCmsSignerInfoGetSigningCertificate(SecCmsSignerInfoRef signerinfo, SecKeychai
     @discussion Returns a CFStringRef containing the common name of the signer.
     @result A return value of NULL is an error.
  */
-extern CFStringRef
+extern CF_RETURNS_RETAINED CFStringRef
 SecCmsSignerInfoGetSignerCommonName(SecCmsSignerInfoRef sinfo);
 
 /*!
@@ -150,7 +125,7 @@ SecCmsSignerInfoGetSignerCommonName(SecCmsSignerInfoRef sinfo);
     @discussion Returns a CFStringRef containing the name of the signer.
     @result A return value of NULL is an error.
  */
-extern CFStringRef
+extern CF_RETURNS_RETAINED CFStringRef
 SecCmsSignerInfoGetSignerEmailAddress(SecCmsSignerInfoRef sinfo);
 
 /*!
@@ -192,13 +167,6 @@ SecCmsSignerInfoAddSMIMEEncKeyPrefs(SecCmsSignerInfoRef signerinfo, SecCertifica
 OSStatus
 SecCmsSignerInfoAddMSSMIMEEncKeyPrefs(SecCmsSignerInfoRef signerinfo, SecCertificateRef cert, SecKeychainRef keychainOrArray);
 
-/*!
-    @function
-    @abstract Create a timestamp unsigned attribute with a TimeStampToken.
- */
-OSStatus
-SecCmsSignerInfoAddTimeStamp(SecCmsSignerInfoRef signerinfo, CSSM_DATA *tstoken);
-
 /*!
     @function
     @abstract Countersign a signerinfo.
@@ -207,6 +175,14 @@ extern OSStatus
 SecCmsSignerInfoAddCounterSignature(SecCmsSignerInfoRef signerinfo,
                                    SECOidTag digestalg, SecIdentityRef identity);
 
+/*!
+     @function
+     @abstract Add the Apple Codesigning Hash Agility attribute to the authenticated (i.e. signed) attributes of "signerinfo".
+     @discussion This is expected to be included in outgoing signed Apple code signatures.
+*/
+OSStatus
+SecCmsSignerInfoAddAppleCodesigningHashAgility(SecCmsSignerInfoRef signerinfo, CFDataRef attrValue);
+
 /*!
     @function
     @abstract The following needs to be done in the S/MIME layer code after signature of a signerinfo has been verified.
@@ -231,14 +207,6 @@ SecCmsSignerInfoIncludeCerts(SecCmsSignerInfoRef signerinfo, SecCmsCertChainMode
 extern const char *
 SecCmsUtilVerificationStatusToString(SecCmsVerificationStatus vs);
 
-/*
- * Preference domain and key for the Microsoft ECDSA compatibility flag. 
- * Default if not present is TRUE, meaning we generate ECDSA-signed messages
- * which are compatible with Microsoft Entourage. FALSE means we adhere to 
- * the spec (RFC 3278 section 2.1.1).
- */
-#define kMSCompatibilityDomain "com.apple.security.smime"
-#define kMSCompatibilityMode   CFSTR("MSCompatibilityMode")
 
 #if defined(__cplusplus)
 }