2 * The contents of this file are subject to the Mozilla Public
3 * License Version 1.1 (the "License"); you may not use this file
4 * except in compliance with the License. You may obtain a copy of
5 * the License at http://www.mozilla.org/MPL/
7 * Software distributed under the License is distributed on an "AS
8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 * implied. See the License for the specific language governing
10 * rights and limitations under the License.
12 * The Original Code is the Netscape security libraries.
14 * The Initial Developer of the Original Code is Netscape
15 * Communications Corporation. Portions created by Netscape are
16 * Copyright (C) 1994-2000 Netscape Communications Corporation. All
21 * Alternatively, the contents of this file may be used under the
22 * terms of the GNU General Public License Version 2 or later (the
23 * "GPL"), in which case the provisions of the GPL are applicable
24 * instead of those above. If you wish to allow use of your
25 * version of this file only under the terms of the GPL and not to
26 * allow others to use your version of this file under the MPL,
27 * indicate your decision by deleting the provisions above and
28 * replace them with the notice and other provisions required by
29 * the GPL. If you do not delete the provisions above, a recipient
30 * may use your version of this file under either the MPL or the
37 * secoid.h - public data structures and prototypes for ASN.1 OID functions
40 #include <security_asn1/seccomon.h>
41 #include <security_asn1/plarenas.h>
42 #include <Security/secasn1t.h>
44 #include <security_smime/secoidt.h>
48 extern const SecAsn1Template SECOID_AlgorithmIDTemplate
[];
50 /* This functions simply returns the address of the above-declared template. */
51 SEC_ASN1_CHOOSER_DECLARE(SECOID_AlgorithmIDTemplate
)
54 * OID handling routines
56 extern SECOidData
*SECOID_FindOID(const SECItem
*oid
);
57 extern SECOidTag
SECOID_FindOIDTag(const SECItem
*oid
);
58 extern SECOidData
*SECOID_FindOIDByTag(SECOidTag tagnum
);
59 extern SECOidData
*SECOID_FindOIDByCssmAlgorithm(CSSM_ALGORITHMS cssmAlgorithm
);
61 /****************************************/
63 ** Algorithm id handling operations
67 ** Fill in an algorithm-ID object given a tag and some parameters.
68 ** "aid" where the DER encoded algorithm info is stored (memory
70 ** "tag" the tag defining the algorithm (SEC_OID_*)
71 ** "params" if not NULL, the parameters to go with the algorithm
73 extern SECStatus
SECOID_SetAlgorithmID(PRArenaPool
*arena
, SECAlgorithmID
*aid
,
74 SECOidTag tag
, SECItem
*params
);
77 ** Copy the "src" object to "dest". Memory is allocated in "dest" for
78 ** each of the appropriate sub-objects. Memory in "dest" is not freed
79 ** before memory is allocated (use SECOID_DestroyAlgorithmID(dest, PR_FALSE)
82 extern SECStatus
SECOID_CopyAlgorithmID(PRArenaPool
*arena
, SECAlgorithmID
*dest
,
83 const SECAlgorithmID
*src
);
86 ** Get the SEC_OID_* tag for the given algorithm-id object.
88 extern SECOidTag
SECOID_GetAlgorithmTag(const SECAlgorithmID
*aid
);
91 ** Destroy an algorithm-id object.
92 ** "aid" the certificate-request to destroy
93 ** "freeit" if PR_TRUE then free the object as well as its sub-objects
95 extern void SECOID_DestroyAlgorithmID(SECAlgorithmID
*aid
, Boolean freeit
);
98 ** Compare two algorithm-id objects, returning the difference between
101 extern SECComparison
SECOID_CompareAlgorithmID(const SECAlgorithmID
*a
,
102 const SECAlgorithmID
*b
);
104 extern Boolean
SECOID_KnownCertExtenOID (const SECItem
*extenOid
);
106 /* Given a SEC_OID_* tag, return a string describing it.
108 extern const char *SECOID_FindOIDTagDescription(SECOidTag tagnum
);
111 * free up the oid data structures.
113 extern SECStatus
SECOID_Shutdown(void);
118 #endif /* _SECOID_H_ */