]>
git.saurik.com Git - apple/security.git/blob - CdsaUtils/cuTimeStr.h
2 * Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License.
7 * Please obtain a copy of the License at http://www.apple.com/publicsource
8 * and read it before using this file.
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
12 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
13 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
15 * Please see the License for the specific language governing rights
16 * and limitations under the License.
20 * cuTimeStr.h = Time string utilities.
27 #include <Security/x509defs.h>
29 #define UTC_TIME_STRLEN 13
30 #define CSSM_TIME_STRLEN 14 /* no trailing 'Z' */
31 #define GENERALIZED_TIME_STRLEN 15
38 * Given a string containing either a UTC-style or "generalized time"
39 * time string, convert to a struct tm (in GMT/UTC). Returns nonzero on
54 * Return an APP_MALLOCd time string, specified format and time relative
55 * to 'now' in seconds.
57 char *cuTimeAtNowPlus(
62 * Convert a CSSM_X509_TIME, which can be in any of three forms (UTC,
63 * generalized, or CSSM_TIMESTRING) into a CSSM_TIMESTRING. Caller
64 * must free() the result. Returns NULL if x509time is badly formed.
66 char *cuX509TimeToCssmTimestring(
67 const CSSM_X509_TIME
*x509Time
,
68 unsigned *rtnLen
); // for caller's convenience
74 #endif /* _TIME_STR_H_ */