| RSA BSAFE Cert-C Micro Edition |
The power of PKI for the smallest of devices |
00001 /* $Id: r_skey.h,v 1.33 2002/10/16 06:19:44 jmckee Exp $ */
00002 /*
00003 * Copyright (C) 1998-2002 RSA Security Inc. All rights reserved.
00004 *
00005 * This work contains proprietary information of RSA Security.
00006 * Distribution is limited to authorized licensees of RSA
00007 * Security. Any unauthorized reproduction, distribution or
00008 * modification of this work is strictly prohibited.
00009 *
00010 */
00011 /**
00012 * @file
00013 * This file contains defines and structures for symmetric key
00014 * manipulation.
00015 */
00016
00017 #ifndef HEADER_COMMON_R_SKEY_H
00018 #define HEADER_COMMON_R_SKEY_H
00019
00020 #ifdef __cplusplus
00021 extern "C" {
00022 #endif
00023
00024 #include "r_com.h"
00025 #include "r_lib.h"
00026
00027 /**
00028 * @defgroup SKEY_GROUP Symmetric Key Operations
00029 * This section details the functions that facilitate symmetric key
00030 * processing, as well as providing details of symmetric key types and
00031 * outlining the identifiers used to retrieve symmetric key information.
00032 * @ingroup KEYS_GROUP
00033 * @{
00034 */
00035 /**
00036 * @}
00037 */
00038
00039 /**
00040 * @defgroup SKEY_TYPE Types
00041 * This section details the symmetric key types that #R_SKEY can handle.
00042 * @ingroup SKEY_GROUP
00043 * @{
00044 */
00045
00046 /** Indicates that the type of symmetric key is unknown. */
00047 #define R_SKEY_TYPE_UNKNOWN (-1)
00048 /** Indicates that the type of symmetric key is in raw binary (generic) form.
00049 */
00050 #define R_SKEY_TYPE_GENERIC 1
00051
00052 /**
00053 * @}
00054 */
00055
00056 /**
00057 * @defgroup SKEY_ID Information Identifiers
00058 * This section outlines the identifiers that can be used to obtain
00059 * symmetric key information.
00060 * The following table lists the data types to pass into <i>param</i> when
00061 * calling R_SKEY_get_info().
00062 * @br
00063 * <table><tr>
00064 * <td><b>Identifier</b></td>
00065 * <td><b>Param Data Type</b></td>
00066 * </tr><tr>
00067 * <td>#R_SKEY_INFO_ID_VALUE</td>
00068 * <td>#R_ITEM *</td>
00069 * </tr><tr>
00070 * </tr></table>
00071 * @br
00072 * @ingroup SKEY_GROUP
00073 * @{
00074 */
00075
00076 /** Indicates the #R_SKEY information identifiers. */
00077 #define R_SKEY_INFO_ID_VALUE 0
00078
00079 /**
00080 * @}
00081 */
00082
00083 /** This opaque structure is used for symmetric key storage. */
00084 typedef struct r_skey_st R_SKEY;
00085
00086 /** This opaque structure is used for symmetric key methods storage. */
00087 typedef struct r_skey_method_st R_SKEY_METHOD;
00088
00089 /**
00090 * @defgroup SKEY_ALL_FUNCS Operation Functions
00091 * This section details the functions which facilitate symmetric key
00092 * cryptography.
00093 * @ingroup SKEY_GROUP
00094 * @{
00095 */
00096
00097 int R_SKEY_new(R_LIB_CTX *ctx, int key_type, R_ITEM *key_descriptor,
00098 R_SKEY **new_skey);
00099 int R_SKEY_free(R_SKEY *skey);
00100 int R_SKEY_get_info(R_SKEY *skey, int id, void *param);
00101 int R_SKEY_set_info(R_SKEY *skey, int id, void *param);
00102
00103 /**
00104 * @}
00105 */
00106
00107 #ifdef __cplusplus
00108 }
00109 #endif
00110
00111 #endif /* HEADER_COMMON_R_SKEY_H */
00112