/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* convert DER utc time to ascii time string */ char *
DER_UTCTimeToAscii(SECItem *utcTime)
{ return (DecodeUTCTime2FormattedAscii(utcTime, "%a %b %d %H:%M:%S %Y"));
}
/* convert DER utc time to ascii time string, only include day, not time */ char *
DER_UTCDayToAscii(SECItem *utctime)
{ return (DecodeUTCTime2FormattedAscii(utctime, "%a %b %d, %Y"));
}
/* convert DER generalized time to ascii time string, only include day,
not time */ char *
DER_GeneralizedDayToAscii(SECItem *gentime)
{ return (DecodeGeneralizedTime2FormattedAscii(gentime, "%a %b %d, %Y"));
}
/* convert DER generalized or UTC time to ascii time string, only include
day, not time */ char *
DER_TimeChoiceDayToAscii(SECItem *timechoice)
{ switch (timechoice->type) {
case siUTCTime: return DER_UTCDayToAscii(timechoice);
case siGeneralizedTime: return DER_GeneralizedDayToAscii(timechoice);
/* Decompose time into components */
PR_ExplodeTime(genTime, PR_GMTParameters, &printableTime);
timeString = (char *)PORT_Alloc(256);
if (timeString) { if (!PR_FormatTime(timeString, 256, format, &printableTime)) {
PORT_Free(timeString);
timeString = NULL;
PORT_SetError(SEC_ERROR_OUTPUT_LEN);
}
}
return (timeString);
}
/* convert DER utc time to ascii time string, The format of the time string depends on the input "format"
*/ staticchar *
DecodeUTCTime2FormattedAscii(SECItem *utcTimeDER, char *format)
{
PRTime utcTime; int rv;
/* convert DER utc time to ascii time string, The format of the time string depends on the input "format"
*/ staticchar *
DecodeGeneralizedTime2FormattedAscii(SECItem *generalizedTimeDER, char *format)
{
PRTime generalizedTime; int rv;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.