/*
 * Portions of this file Copyright 1999-2005 University of Chicago
 * Portions of this file Copyright 1999-2005 The University of Southern California.
 *
 * This file or a portion of this file is licensed under the
 * terms of the Globus Toolkit Public License, found at
 * http://www.globus.org/toolkit/download/license.html.
 * If you redistribute this file, with or without
 * modifications, you must include this notice in the file.
 */


#ifndef _GLOBUS_WS_SECURITY_H_
#define _GLOBUS_WS_SECURITY_H_

#include "globus_common.h"

EXTERN_C_BEGIN

#include "globus_gsi_credential.h"
#include "openssl/x509.h"

#define GLOBUS_HANDLER_WS_SECMESS_LIB "globus_handler_ws_secure_message"
#define GLOBUS_HANDLER_WS_SECMESS_MODULE "ws_secure_message"
#define GLOBUS_HANDLER_WS_SECMESS_CLIENT "globus_handler_ws_secure_message_client"
#define GLOBUS_HANDLER_WS_SECMESS_SERVER "globus_handler_ws_secure_message_server"

#define GLOBUS_HANDLER_WS_SECCONV_LIB "globus_handler_ws_secure_conv"
#define GLOBUS_HANDLER_WS_SECCONV_MODULE "ws_secure_conv"
#define GLOBUS_HANDLER_WS_SECCONV_CLIENT "globus_handler_ws_secure_conv_client"
#define GLOBUS_HANDLER_WS_SECCONV_SERVER "globus_handler_ws_secure_conv_server"

#define WSSE_NS "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"

#define GLOBUS_HANDLER_WSSE_USER_CREDENTIAL_KEY       WSSE_NS"#UserCredential"
#define GLOBUS_HANDLER_WSSE_DESIRED_SUBJECT_KEY       WSSE_NS"#DesiredSubject"
#define GLOBUS_HANDLER_WSSE_MESSAGE_DURATION_KEY      WSSE_NS"#MessageDuration"
#define GLOBUS_HANDLER_WSSE_CACHE_EXPIRATION_KEY      WSSE_NS"#CacheExpiration"


#define GLOBUS_HANDLER_WSSE_MARKER_SECURITY_BEGIN \
    "SECURITY_BEGIN"
#define GLOBUS_HANDLER_WSSE_MARKER_SECURITY_END \
    "SECURITY_END"
#define GLOBUS_HANDLER_WSSE_MARKER_SECURITY_CONTENT_BEGIN \
    "SECURITY_CONTENT_BEGIN"
#define GLOBUS_HANDLER_WSSE_MARKER_SECURITY_CONTENT_END \
    "SECURITY_CONTENT_END"
#define GLOBUS_HANDLER_WSSE_MARKER_SIGNATURE_BEGIN \
    "SIGNATURE_BEGIN"
#define GLOBUS_HANDLER_WSSE_MARKER_SIGNATURE_END \
    "SIGNATURE_END"
#define GLOBUS_HANDLER_WSSE_MARKER_TIMESTAMP_BEGIN \
    "SIGNATURE_TIMESTAMP_BEGIN"
#define GLOBUS_HANDLER_WSSE_MARKER_TIMESTAMP_END \
    "SIGNATURE_TIMESTAMP_END"
#define GLOBUS_HANDLER_WSSE_MARKER_SIGNED_INFO_BEGIN \
    "SIGNED_INFO_BEGIN"
#define GLOBUS_HANDLER_WSSE_MARKER_SIGNED_INFO_END \
    "SIGNED_INFO_END"

extern globus_module_descriptor_t globus_i_ws_security_module;

#define GLOBUS_WS_SECURITY_MODULE &globus_i_ws_security_module

globus_result_t
globus_ws_security_create_pkipath(
    globus_gsi_cred_handle_t            cred,
    char **                             encoded_buffer,
    int *                               encoded_length);

globus_result_t
globus_ws_security_get_credential(
    const unsigned char *               encoded_buff,
    int                                 encoded_length,
    globus_gsi_cred_handle_t *          new_cred);

EXTERN_C_END

#endif
