xref: /titanic_44/usr/src/common/crypto/ecc/secoidt.h (revision a4aeef46cda1835da2b19f8f62b4526de6521e6c)
1 /* ***** BEGIN LICENSE BLOCK *****
2  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3  *
4  * The contents of this file are subject to the Mozilla Public License Version
5  * 1.1 (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  * http://www.mozilla.org/MPL/
8  *
9  * Software distributed under the License is distributed on an "AS IS" basis,
10  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11  * for the specific language governing rights and limitations under the
12  * License.
13  *
14  * The Original Code is the Netscape security libraries.
15  *
16  * The Initial Developer of the Original Code is
17  * Netscape Communications Corporation.
18  * Portions created by the Initial Developer are Copyright (C) 1994-2000
19  * the Initial Developer. All Rights Reserved.
20  *
21  * Contributor(s):
22  *   Dr Vipul Gupta <vipul.gupta@sun.com>, Sun Microsystems Laboratories
23  *
24  * Alternatively, the contents of this file may be used under the terms of
25  * either the GNU General Public License Version 2 or later (the "GPL"), or
26  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27  * in which case the provisions of the GPL or the LGPL are applicable instead
28  * of those above. If you wish to allow use of your version of this file only
29  * under the terms of either the GPL or the LGPL, and not to allow others to
30  * use your version of this file under the terms of the MPL, indicate your
31  * decision by deleting the provisions above and replace them with the notice
32  * and other provisions required by the GPL or the LGPL. If you do not delete
33  * the provisions above, a recipient may use your version of this file under
34  * the terms of any one of the MPL, the GPL or the LGPL.
35  *
36  * ***** END LICENSE BLOCK ***** */
37 /*
38  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
39  * Use is subject to license terms.
40  *
41  * Sun elects to use this software under the MPL license.
42  */
43 
44 #ifndef _SECOIDT_H_
45 #define _SECOIDT_H_
46 
47 #pragma ident	"%Z%%M%	%I%	%E% SMI"
48 
49 /*
50  * secoidt.h - public data structures for ASN.1 OID functions
51  *
52  * $Id: secoidt.h,v 1.23 2007/05/05 22:45:16 nelson%bolyard.com Exp $
53  */
54 
55 typedef struct SECOidDataStr SECOidData;
56 typedef struct SECAlgorithmIDStr SECAlgorithmID;
57 
58 /*
59 ** An X.500 algorithm identifier
60 */
61 struct SECAlgorithmIDStr {
62     SECItem algorithm;
63     SECItem parameters;
64 };
65 
66 #define SEC_OID_SECG_EC_SECP192R1 SEC_OID_ANSIX962_EC_PRIME192V1
67 #define SEC_OID_SECG_EC_SECP256R1 SEC_OID_ANSIX962_EC_PRIME256V1
68 #define SEC_OID_PKCS12_KEY_USAGE  SEC_OID_X509_KEY_USAGE
69 
70 /* fake OID for DSS sign/verify */
71 #define SEC_OID_SHA SEC_OID_MISS_DSS
72 
73 typedef enum {
74     INVALID_CERT_EXTENSION = 0,
75     UNSUPPORTED_CERT_EXTENSION = 1,
76     SUPPORTED_CERT_EXTENSION = 2
77 } SECSupportExtenTag;
78 
79 struct SECOidDataStr {
80     SECItem            oid;
81     ECCurveName        offset;
82     const char *       desc;
83     unsigned long      mechanism;
84     SECSupportExtenTag supportedExtension;
85     				/* only used for x.509 v3 extensions, so
86 				   that we can print the names of those
87 				   extensions that we don't even support */
88 };
89 
90 #endif /* _SECOIDT_H_ */
91