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