eapol/eapol_framework/wapi_common/include/wapi_asn1_der_parser.h
changeset 17 8840d3e38314
equal deleted inserted replaced
2:1c7bc153c08e 17:8840d3e38314
       
     1 /*
       
     2 * ============================================================================
       
     3 *  Name        : ./accesssec/eapol/eapol_framework/wapi_common/include/wapi_asn1_der_parser.h
       
     4 *  Part of     : WAPI / WAPI       *** Info from the SWAD
       
     5 *  Description : WAPI authentication
       
     6 *  Version     : %version: 6 % << Don't touch! Updated by Synergy at check-out.
       
     7 *
       
     8 *  Copyright © 2001-2009 Nokia.  All rights reserved.
       
     9 *  This material, including documentation and any related computer
       
    10 *  programs, is protected by copyright controlled by Nokia.  All
       
    11 *  rights are reserved.  Copying, including reproducing, storing,
       
    12 *  adapting or translating, any or all of this material requires the
       
    13 *  prior written consent of Nokia.  This material also contains
       
    14 *  confidential information which may not be disclosed to others
       
    15 *  without the prior written consent of Nokia.
       
    16 * ============================================================================
       
    17 * Template version: 4.2
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #if !defined(_WAPI_ASN1_DER_PARSER_H_)
       
    23 #define _WAPI_ASN1_DER_PARSER_H_
       
    24 
       
    25 #include "eap_variable_data.h"
       
    26 #include "eap_am_export.h"
       
    27 #include "eap_array.h"
       
    28 #include "asn1_der_type.h"
       
    29 
       
    30 //--------------------------------------------------
       
    31 
       
    32 class EAP_EXPORT wapi_asn1_der_parser_c
       
    33 {
       
    34 	//--------------------------------------------------
       
    35 public:
       
    36 	//--------------------------------------------------
       
    37 
       
    38 	EAP_FUNC_IMPORT virtual ~wapi_asn1_der_parser_c();
       
    39 
       
    40 	EAP_FUNC_IMPORT wapi_asn1_der_parser_c(
       
    41 		abs_eap_am_tools_c * const tools);
       
    42 
       
    43 	/**
       
    44 	 * The get_is_valid() function returns the status of the wapi_asn1_der_parser_c object.
       
    45 	 * @return True indicates the object is initialized.
       
    46 	 */
       
    47 	EAP_FUNC_IMPORT bool get_is_valid() const;
       
    48 
       
    49 	EAP_FUNC_IMPORT u32_t get_index() const;
       
    50 
       
    51 	/**
       
    52 	 * The decode() function decodes ASN.1/DER data.
       
    53 	 * Data can include many ASN.1/DER objects.
       
    54 	 * @return eap_status_ok indicates successfull operation.
       
    55 	 */
       
    56 	EAP_FUNC_IMPORT eap_status_e decode(const eap_variable_data_c * const asn1_der_data);
       
    57 
       
    58 
       
    59 	EAP_FUNC_IMPORT const asn1_der_type_c * get_object(const u32_t index) const;
       
    60 
       
    61 	EAP_FUNC_IMPORT u32_t get_object_count() const;
       
    62 
       
    63 
       
    64 	/**
       
    65 	 * The get_wapi_identity() function copies the WAPI identity data.
       
    66 	 * First you must call decode() function with the input data.
       
    67 	 * @return eap_status_ok indicates successfull operation.
       
    68 	 */
       
    69 	EAP_FUNC_IMPORT eap_status_e get_wapi_identity(
       
    70 		eap_variable_data_c * const subject_name,
       
    71 		eap_variable_data_c * const issuer_name,
       
    72 		eap_variable_data_c * const sequence_number);
       
    73 
       
    74 	/**
       
    75 	 * The get_wapi_identity() function copies the WAPI identity data.
       
    76 	 * First you must call decode() function with the input data.
       
    77 	 * @return eap_status_ok indicates successfull operation.
       
    78 	 */
       
    79 	EAP_FUNC_IMPORT eap_status_e get_wapi_identity(
       
    80 		eap_variable_data_c * const wapi_identity);
       
    81 	/**
       
    82 	 * The get_decoded_subject_name() function parses and
       
    83 	 * returns the certificate identity subject name
       
    84 	 * @return eap_status_ok indicates successfull operation.
       
    85 	 */
       
    86 	EAP_FUNC_IMPORT eap_status_e get_decoded_subject_name(
       
    87 	    eap_variable_data_c * const identity_data,
       
    88 	    eap_variable_data_c * const decoded_data);
       
    89 	    
       
    90 
       
    91 	//--------------------------------------------------
       
    92 private:
       
    93 	//--------------------------------------------------
       
    94 
       
    95 	abs_eap_am_tools_c * const m_am_tools;
       
    96 
       
    97 	bool m_is_valid;
       
    98 
       
    99 	eap_array_c<asn1_der_type_c> m_objects;
       
   100 
       
   101 	//--------------------------------------------------
       
   102 };
       
   103 
       
   104 //--------------------------------------------------------------------------------------------------
       
   105 
       
   106 #endif //#if !defined(_WAPI_ASN1_DER_PARSER_H_)
       
   107 
       
   108 //--------------------------------------------------------------------------------------------------
       
   109 
       
   110 // End.