2N/A/*
2N/A * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A#ifndef _RDN_PARSER_H
2N/A#define _RDN_PARSER_H
2N/A
2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A/*
2N/A * The contents of this file are subject to the Mozilla Public
2N/A * License Version 1.1 (the "License"); you may not use this file
2N/A * except in compliance with the License. You may obtain a copy of
2N/A * the License at http://www.mozilla.org/MPL/
2N/A *
2N/A * Software distributed under the License is distributed on an "AS
2N/A * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
2N/A * implied. See the License for the specific language governing
2N/A * rights and limitations under the License.
2N/A *
2N/A * The Original Code is the Netscape security libraries.
2N/A *
2N/A * The Initial Developer of the Original Code is Netscape
2N/A * Communications Corporation. Portions created by Netscape are
2N/A * Copyright (C) 1994-2000 Netscape Communications Corporation. All
2N/A * Rights Reserved.
2N/A *
2N/A * Contributor(s):
2N/A *
2N/A * Alternatively, the contents of this file may be used under the
2N/A * terms of the GNU General Public License Version 2 or later (the
2N/A * "GPL"), in which case the provisions of the GPL are applicable
2N/A * instead of those above. If you wish to allow use of your
2N/A * version of this file only under the terms of the GPL and not to
2N/A * allow others to use your version of this file under the MPL,
2N/A * indicate your decision by deleting the provisions above and
2N/A * replace them with the notice and other provisions required by
2N/A * the GPL. If you do not delete the provisions above, a recipient
2N/A * may use your version of this file under either the MPL or the
2N/A * GPL.
2N/A */
2N/A
2N/Atypedef enum {
2N/A OID_AVA_COMMON_NAME = 0,
2N/A OID_AVA_SURNAME,
2N/A OID_AVA_GIVEN_NAME,
2N/A OID_AVA_LOCALITY,
2N/A OID_AVA_STATE_OR_PROVINCE,
2N/A OID_AVA_ORGANIZATION_NAME,
2N/A OID_AVA_ORGANIZATIONAL_UNIT_NAME,
2N/A OID_AVA_COUNTRY_NAME,
2N/A OID_AVA_STREET_ADDRESS,
2N/A OID_AVA_DC,
2N/A OID_RFC1274_UID,
2N/A OID_PKCS9_EMAIL_ADDRESS,
2N/A OID_RFC1274_MAIL,
2N/A OID_UNKNOWN
2N/A} OidAvaTag;
2N/A
2N/Astruct NameToKind {
2N/A const char *name;
2N/A OidAvaTag kind;
2N/A KMF_OID *OID;
2N/A};
2N/A
2N/A#define C_DOUBLE_QUOTE '\042'
2N/A
2N/A#define C_BACKSLASH '\134'
2N/A
2N/A#define C_EQUAL '='
2N/A
2N/A#define OPTIONAL_SPACE(c) \
2N/A (((c) == ' ') || ((c) == '\r') || ((c) == '\n'))
2N/A
2N/A#define SPECIAL_CHAR(c) \
2N/A (((c) == ',') || ((c) == '=') || ((c) == C_DOUBLE_QUOTE) || \
2N/A ((c) == '\r') || ((c) == '\n') || ((c) == '+') || \
2N/A ((c) == '<') || ((c) == '>') || ((c) == '#') || \
2N/A ((c) == ';') || ((c) == C_BACKSLASH))
2N/A
2N/A
2N/A#define IS_PRINTABLE(c) \
2N/A ((((c) >= 'a') && ((c) <= 'z')) || \
2N/A (((c) >= 'A') && ((c) <= 'Z')) || \
2N/A (((c) >= '0') && ((c) <= '9')) || \
2N/A ((c) == ' ') || \
2N/A ((c) == '\'') || \
2N/A ((c) == '\050') || /* ( */ \
2N/A ((c) == '\051') || /* ) */ \
2N/A (((c) >= '+') && ((c) <= '/')) || /* + , - . / */ \
2N/A ((c) == ':') || \
2N/A ((c) == '=') || \
2N/A ((c) == '?'))
2N/A
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A#endif /* _RDN_PARSER_H */