xref: /illumos-gate/usr/src/common/crypto/ecc/secoidt.h (revision c40a6cd785e883b3f052b122c332e21174fc1871)
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 /*
48  * secoidt.h - public data structures for ASN.1 OID functions
49  *
50  * $Id: secoidt.h,v 1.23 2007/05/05 22:45:16 nelson%bolyard.com Exp $
51  */
52 
53 typedef struct SECOidDataStr SECOidData;
54 typedef struct SECAlgorithmIDStr SECAlgorithmID;
55 
56 /*
57 ** An X.500 algorithm identifier
58 */
59 struct SECAlgorithmIDStr {
60     SECItem algorithm;
61     SECItem parameters;
62 };
63 
64 #define SEC_OID_SECG_EC_SECP192R1 SEC_OID_ANSIX962_EC_PRIME192V1
65 #define SEC_OID_SECG_EC_SECP256R1 SEC_OID_ANSIX962_EC_PRIME256V1
66 #define SEC_OID_PKCS12_KEY_USAGE  SEC_OID_X509_KEY_USAGE
67 
68 /* fake OID for DSS sign/verify */
69 #define SEC_OID_SHA SEC_OID_MISS_DSS
70 
71 typedef enum {
72     INVALID_CERT_EXTENSION = 0,
73     UNSUPPORTED_CERT_EXTENSION = 1,
74     SUPPORTED_CERT_EXTENSION = 2
75 } SECSupportExtenTag;
76 
77 struct SECOidDataStr {
78     SECItem            oid;
79     ECCurveName        offset;
80     const char *       desc;
81     unsigned long      mechanism;
82     SECSupportExtenTag supportedExtension;
83     				/* only used for x.509 v3 extensions, so
84 				   that we can print the names of those
85 				   extensions that we don't even support */
86 };
87 
88 #endif /* _SECOIDT_H_ */
89