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 * 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 * The Original Code is the Netscape security libraries. 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 * 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 * Copyright 2010 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * The order here is important. The OIDs are arranged in order of 2N/A * significance. The CN is the most specific value, the C (country) 2N/A * is less specific, etc. Add to this list with care. 2N/A /* skip optional leading space */ 2N/A /* null-terminate tagBuf -- guaranteed at least one space left */ 2N/A * skip trailing spaces till we hit something - should be 2N/A /* should be an equal sign */ 2N/A /* skip over the equal sign */ 2N/A /* skip optional leading space */ 2N/A /* escape character */ 2N/A * escape charater must appear with paired char 2N/A /* unescaped special and not within quoted value */ 2N/A /* reached unescaped double quote */ 2N/A /* append character */ 2N/A /* stip trailing spaces from unquoted values */ 2N/A /* insist that we stopped on a double quote */ 2N/A /* skip over the quote and skip optional space */ 2N/A /* empty value -- not allowed */ 2N/A /* null-terminate valBuf -- guaranteed at least one space left */ 2N/A /* Each RDN has 1 AttrTypeAndValue */ 2N/A /* Illegal AVA type */ 2N/A /* insist that if we haven't finished we've stopped on a separator */ 2N/A /* ok, skip over separator */ 2N/A * Hack -- for rationale see X.520 2N/A * DirectoryString defn 2N/A /* matched no kind -- invalid tag */ 2N/A * The "Name2Kinds" list is ordered by significance. 2N/A * Compare the "ranking" of each of the OIDs to determine 2N/A else /* If equal, treat as if it is less than */ 2N/A * Canonicalize the DN by sorting the elements 2N/A * in little-endian order, as per RFC 1485: 2N/A * order (most significant component last)." 2N/A * Generic routine to compare 2 RDN structures. 2N/A * Because the ordering of the AV pairs may not be 2N/A * the same, we must compare each AV pair individually 2N/A * Return 0 if equal, 1 if not. 2N/A * If the current AV from name1 was not found in name2, 2N/A /* If we got this far, it must be a match */ 2N/A * Public interface for parsing a Distinguished name in 2N/A * human-readable format into a binary KMF_X509_NAME.