org.openorb.orb.csiv2
Class CSICompoundSecMechList

java.lang.Object
  extended by org.openorb.orb.csiv2.CSICompoundSecMechList

public final class CSICompoundSecMechList
extends java.lang.Object

This is a convenience wrapper class around the CompoundSecMechList class. It provides helper methods to retrieve all data from the CompoundSecMechList class in an easy way.

Author:
Michael Rumpf

Method Summary
static CSICompoundSecMechList create(org.omg.IOP.Codec codec, byte[] data)
          Decode a CORBA Any from the byte array and extract a CompoundSecMechList instance from them CORBA Any.
static CSICompoundSecMechList create(org.omg.IOP.Codec codec, CompoundSecMechList csml)
          This method just wraps this class around an instance of type CompoundSecMechList.
static CSICompoundSecMechList create(org.omg.CORBA.ORB orb, org.omg.IOP.Codec codec, CSITlsSecTrans ssl_trans, short as_target_supports, short as_target_requires, java.lang.String realm, short sas_target_supports, int sas_identity_types)
          This method creates an instance of type CompoundSecMechList and wraps this class around.
 AS_ContextSec getASContextSec(int index)
          Return the AS_ContextSec instance.
 byte[] getASContextSecClientAuthenticationMech(int index)
          Return the authentication mechanism oid as byte array.
 java.lang.String getASContextSecClientAuthenticationMechString(int index)
          Return the authentication mechanism oid as string.
 byte[] getASContextSecTargetName(int index)
          Return the target name as byte array.
 java.lang.String getASContextSecTargetNameString(int index)
          Return the target name as string.
 short getASContextSecTargetRequires(int index)
          Return the bit field from AS_ContextSec.target_requires of the security mechanism specified by the index.
 java.lang.String getASContextSecTargetRequiresString(int index)
          Return the a stringified representation of the bit field from AS_ContextSec.target_requires of the security mechanism specified by the index.
 short getASContextSecTargetSupports(int index)
          Return the bit field from AS_ContextSec.target_supports of the security mechanism specified by the index.
 java.lang.String getASContextSecTargetSupportsString(int index)
          Return the a stringified representation of the bit field from AS_ContextSec.target_supports of the security mechanism specified by the index.
 byte[] getEncoded(org.omg.CORBA.ORB orb)
          Return the GIOP encoded byte array of the instance this class is wrapping.
 CompoundSecMechList getInternal()
          Return the instance this class is wrapping.
static java.lang.String getOIDInfo(java.lang.String oid)
          Return an info about the oid or UNKNOWN when the oid is not known.
 SAS_ContextSec getSASContextSec(int index)
          Return the SAS_ContextSec instance.
 int getSASContextSecPrivilegeAuthoritiesCount(int index)
          Return the number of privilege authorities for the specified security mechanism.
 ServiceConfiguration getSASContextSecPrivilegeAuthority(int index, int auth_index)
          Return a privilege authority from the given security mechanism.
 byte[] getSASContextSecPrivilegeAuthorityName(int index, int auth_index)
          Return the name field of a privilege authority from the given security mechanism.
 int getSASContextSecPrivilegeAuthoritySyntax(int index, int auth_index)
          Return the syntax field of a privilege authority from the given security mechanism.
 int getSASContextSecSupportedIdentityTypes(int index)
          Return the supported identity types from the given security mechanism.
 java.lang.String getSASContextSecSupportedIdentityTypesString(int index)
          Return a stringified representation of the supported identity types from the given security mechanism.
 byte[] getSASContextSecSupportedNamingMechanism(int index, int mech_index)
          Return a supported naming mechanism from the given security mechanism.
 int getSASContextSecSupportedNamingMechanismsCount(int index)
          Return the number of supported naming mechanisms for the specified security mechanism.
 java.lang.String getSASContextSecSupportedNamingMechanismString(int index, int mech_index)
          Return a stringified representation of the supported naming mechanism from the given security mechanism.
 short getSASContextSecTargetRequires(int index)
          Return the bit field from SAS_ContextSec.target_requires of the security mechanism specified by the index.
 java.lang.String getSASContextSecTargetRequiresString(int index)
          Return the a stringified representation of the bit field from SAS_ContextSec.target_requires of the security mechanism specified by the index.
 short getSASContextSecTargetSupports(int index)
          Return the bit field from SAS_ContextSec.target_supports of the security mechanism specified by the index.
 java.lang.String getSASContextSecTargetSupportsString(int index)
          Return the a stringified representation of the bit field from SAS_ContextSec.target_supports of the security mechanism specified by the index.
 CSISeciopSecTrans getSeciopSecTrans(int index)
          Wrap theSECIOP_SEC_TRANS component by the helper class CSISeciopSecTrans.
 CompoundSecMech getSecMech(int index)
          Return the security mechanism specified by the index.
 int getSecMechCount()
          Return the number of security mechanisms.
 short getTargetRequires(int index)
          Return the bit field from CompoundSecMech.target_requires of the security mechanism specified by the index.
 java.lang.String getTargetRequiresString(int index)
          Return the a stringified representation of the bit field from CompoundSecMech.target_requires of the security mechanism specified by the index.
 CSITlsSecTrans getTlsSecTrans(int index)
          Wrap theTLS_SEC_TRANS component by the helper class CSITlsSecTrans.
 byte[] getTransportMechData(int index)
          Return the transport byte array data for the specified security mechanism.
 java.lang.String getTransportMechDataString(int index)
          Return a stringified representation of the transport data.
 int getTransportMechTag(int index)
          Return the transport tag for the specified security mechanism.
 java.lang.String getTransportMechTagString(int index)
          Return the transport tag string for the specified security mechanism.
 boolean isStateful()
          Return whether the CSIv2 implementation supports stateful contexts or not.
 java.lang.String toString()
          This method creates a stringified representation of the CompoundSecMechList class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getOIDInfo

public static java.lang.String getOIDInfo(java.lang.String oid)
Return an info about the oid or UNKNOWN when the oid is not known. The CSIv2 interoperability testbed from Adiron has IORs with Kerberos OIDs embedded. This method just returns a name of what the oid is representing.

Parameters:
oid - The oid to get some info for.
Returns:
An info string describing the specified oid or UNKNOWN when the oid is unknown.

create

public static CSICompoundSecMechList create(org.omg.IOP.Codec codec,
                                            CompoundSecMechList csml)
This method just wraps this class around an instance of type CompoundSecMechList.

Parameters:
codec - The codec to be used for GIOP encoding and decoding.
csml - The instance of type CompoundSecMechList this class is a wrapper for.
Returns:
An instance of this convenience wrapper with a member of type CompoundSecMechList.

create

public static CSICompoundSecMechList create(org.omg.IOP.Codec codec,
                                            byte[] data)
Decode a CORBA Any from the byte array and extract a CompoundSecMechList instance from them CORBA Any.

Parameters:
codec - The codec to use for decoding.
data - The byte array containing the encoded CORBA Any.
Returns:
The decoded CompoundSecMechList instance or null in case an exception occurs.

create

public static CSICompoundSecMechList create(org.omg.CORBA.ORB orb,
                                            org.omg.IOP.Codec codec,
                                            CSITlsSecTrans ssl_trans,
                                            short as_target_supports,
                                            short as_target_requires,
                                            java.lang.String realm,
                                            short sas_target_supports,
                                            int sas_identity_types)
This method creates an instance of type CompoundSecMechList and wraps this class around. The parameters are the ones required for a CSIv2 Level 0 compliant target.

Parameters:
orb - The orb used for encoding the CSITlsSecTrans parameter.
codec - Used for GIOP encoding and decoding.
as_target_supports - The authentication association options the target supports.
as_target_requires - The authentication association options the target requires.
realm - The realm name of the target.
sas_target_supports - The security attribute layer association options the target supports.
sas_identity_types - The identity types the target supports.
Returns:
An instance of this convenience wrapper with a member of type CompoundSecMechList.

getInternal

public CompoundSecMechList getInternal()
Return the instance this class is wrapping.

Returns:
An instance of CompoundSecMechList.

getEncoded

public byte[] getEncoded(org.omg.CORBA.ORB orb)
Return the GIOP encoded byte array of the instance this class is wrapping.

Parameters:
orb - The ORB to get the Any from.
Returns:
A GIOP encoded byte array of the instance of CompoundSecMechList or null in case the decoding failed.

isStateful

public boolean isStateful()
Return whether the CSIv2 implementation supports stateful contexts or not.

Returns:
True when stateful contexts are supported, false otherwise.

getSecMechCount

public int getSecMechCount()
Return the number of security mechanisms.

Returns:
The number of security mechanisms or -1 when the CompoundSecMechList member of this class has not been set.

getSecMech

public CompoundSecMech getSecMech(int index)
Return the security mechanism specified by the index.

Parameters:
index - The index of the security mechanism to return.
Returns:
The security mechanism as an instance of type CompoundSecMech or null when an ArrayIndexOutOfBoundException occured or when the CompoundSecMechList member of this class has not been set.

getTargetRequires

public short getTargetRequires(int index)
Return the bit field from CompoundSecMech.target_requires of the security mechanism specified by the index.

Parameters:
index - The index of the security mechanism for which to return the bit field.
Returns:
The bit field from CompoundSecMech.target_requires or -1 when an ArrayIndexOutOfBoundException occured or when the CompoundSecMechList member of this class has not been set.

getTargetRequiresString

public java.lang.String getTargetRequiresString(int index)
Return the a stringified representation of the bit field from CompoundSecMech.target_requires of the security mechanism specified by the index.

Parameters:
index - The index of the security mechanism for which to return the bit field.
Returns:
The stringified representation of the bit field from CompoundSecMech.target_requires or null when an ArrayIndexOutOfBoundException occured or when the CompoundSecMechList member of this class has not been set.

getTransportMechTag

public int getTransportMechTag(int index)
Return the transport tag for the specified security mechanism.

Parameters:
index - The security mechanism index.
Returns:
The transport tag: TAG_NULL_TAG, TAG_SECIOP_SEC_TRANS, TAG_TLS_SEC_TRANS.

getTransportMechTagString

public java.lang.String getTransportMechTagString(int index)
Return the transport tag string for the specified security mechanism.

Parameters:
index - The security mechanism index.
Returns:
The transport tag string: "e;TAG_NULL_TAG"e;, "e;TAG_SECIOP_SEC_TRANS"e;, "e;TAG_TLS_SEC_TRANS"e;.

getTransportMechData

public byte[] getTransportMechData(int index)
Return the transport byte array data for the specified security mechanism.

Parameters:
index - The security mechanism index.
Returns:
The transport data as byte array.

getTransportMechDataString

public java.lang.String getTransportMechDataString(int index)
Return a stringified representation of the transport data.

Parameters:
index - The security mechanism index.
Returns:
The stringified representation of the transport data.

getSeciopSecTrans

public CSISeciopSecTrans getSeciopSecTrans(int index)
Wrap theSECIOP_SEC_TRANS component by the helper class CSISeciopSecTrans.

Parameters:
index - The security mechanism index.
Returns:
An instance of the CSISeciopSecTrans wrapper.

getTlsSecTrans

public CSITlsSecTrans getTlsSecTrans(int index)
Wrap theTLS_SEC_TRANS component by the helper class CSITlsSecTrans.

Parameters:
index - The security mechanism index.
Returns:
An instance of the CSITlsSecTrans wrapper.

getASContextSec

public AS_ContextSec getASContextSec(int index)
Return the AS_ContextSec instance.

Parameters:
index - The security mechanism index.
Returns:
The AS_ContextSec instance.

getASContextSecTargetSupports

public short getASContextSecTargetSupports(int index)
Return the bit field from AS_ContextSec.target_supports of the security mechanism specified by the index.

Parameters:
index - The index of the security mechanism for which to return the bit field.
Returns:
The bit field from AS_ContextSec.target_supports or -1 when an ArrayIndexOutOfBoundException occured or when the CompoundSecMechList member of this class has not been set.

getASContextSecTargetSupportsString

public java.lang.String getASContextSecTargetSupportsString(int index)
Return the a stringified representation of the bit field from AS_ContextSec.target_supports of the security mechanism specified by the index.

Parameters:
index - The index of the security mechanism for which to return the bit field.
Returns:
The stringified representation of the bit field from AS_ContextSec.target_supports or null when an ArrayIndexOutOfBoundException occured or when the CompoundSecMechList member of this class has not been set.

getASContextSecTargetRequires

public short getASContextSecTargetRequires(int index)
Return the bit field from AS_ContextSec.target_requires of the security mechanism specified by the index.

Parameters:
index - The index of the security mechanism for which to return the bit field.
Returns:
The bit field from AS_ContextSec.target_requires or -1 when an ArrayIndexOutOfBoundException occured or when the CompoundSecMechList member of this class has not been set.

getASContextSecTargetRequiresString

public java.lang.String getASContextSecTargetRequiresString(int index)
Return the a stringified representation of the bit field from AS_ContextSec.target_requires of the security mechanism specified by the index.

Parameters:
index - The index of the security mechanism for which to return the bit field.
Returns:
The stringified representation of the bit field from AS_ContextSec.target_requires or null when an ArrayIndexOutOfBoundException occured or when the CompoundSecMechList member of this class has not been set.

getASContextSecClientAuthenticationMech

public byte[] getASContextSecClientAuthenticationMech(int index)
Return the authentication mechanism oid as byte array.

Parameters:
index - The index of the security mechanism.
Returns:
The byte array containing the encoded oid.

getASContextSecClientAuthenticationMechString

public java.lang.String getASContextSecClientAuthenticationMechString(int index)
Return the authentication mechanism oid as string.

Parameters:
index - The index of the security mechanism.
Returns:
The oid string.

getASContextSecTargetName

public byte[] getASContextSecTargetName(int index)
Return the target name as byte array. The byte array has been created by using the gssExportName method.

Parameters:
index - The index of the security mechanism.
Returns:
The byte array containing the target name.

getASContextSecTargetNameString

public java.lang.String getASContextSecTargetNameString(int index)
Return the target name as string.

Parameters:
index - The index of the security mechanism.
Returns:
The target name string.

getSASContextSec

public SAS_ContextSec getSASContextSec(int index)
Return the SAS_ContextSec instance.

Parameters:
index - The security mechanism index.
Returns:
The SAS_ContextSec instance.

getSASContextSecTargetSupports

public short getSASContextSecTargetSupports(int index)
Return the bit field from SAS_ContextSec.target_supports of the security mechanism specified by the index.

Parameters:
index - The index of the security mechanism for which to return the bit field.
Returns:
The bit field from SAS_ContextSec.target_supports or -1 when an ArrayIndexOutOfBoundException occured or when the CompoundSecMechList member of this class has not been set.

getSASContextSecTargetSupportsString

public java.lang.String getSASContextSecTargetSupportsString(int index)
Return the a stringified representation of the bit field from SAS_ContextSec.target_supports of the security mechanism specified by the index.

Parameters:
index - The index of the security mechanism for which to return the bit field.
Returns:
The stringified representation of the bit field from SAS_ContextSec.target_supports or null when an ArrayIndexOutOfBoundException occured or when the CompoundSecMechList member of this class has not been set.

getSASContextSecTargetRequires

public short getSASContextSecTargetRequires(int index)
Return the bit field from SAS_ContextSec.target_requires of the security mechanism specified by the index.

Parameters:
index - The index of the security mechanism for which to return the bit field.
Returns:
The bit field from SAS_ContextSec.target_requires or -1 when an ArrayIndexOutOfBoundException occured or when the CompoundSecMechList member of this class has not been set.

getSASContextSecTargetRequiresString

public java.lang.String getSASContextSecTargetRequiresString(int index)
Return the a stringified representation of the bit field from SAS_ContextSec.target_requires of the security mechanism specified by the index.

Parameters:
index - The index of the security mechanism for which to return the bit field.
Returns:
The stringified representation of the bit field from SAS_ContextSec.target_requires or null when an ArrayIndexOutOfBoundException occured or when the CompoundSecMechList member of this class has not been set.

getSASContextSecPrivilegeAuthoritiesCount

public int getSASContextSecPrivilegeAuthoritiesCount(int index)
Return the number of privilege authorities for the specified security mechanism.

Parameters:
index - The index of the security mechanism for which to return the number of privilege authorities.
Returns:
The number of privilege authorities or -1 when the CompoundSecMechList member of this class has not been set.

getSASContextSecPrivilegeAuthority

public ServiceConfiguration getSASContextSecPrivilegeAuthority(int index,
                                                               int auth_index)
Return a privilege authority from the given security mechanism.

Parameters:
index - The index of the security mechanism for which to return a privilege authority.
auth_index - The index of the privilege authority to return.
Returns:
An instance of class ServiceConfiguration.

getSASContextSecPrivilegeAuthoritySyntax

public int getSASContextSecPrivilegeAuthoritySyntax(int index,
                                                    int auth_index)
Return the syntax field of a privilege authority from the given security mechanism.

Parameters:
index - The index of the security mechanism for which to return a privilege authority.
auth_index - The index of the privilege authority to return.
Returns:
The content of ServiceConfiguration.syntax.

getSASContextSecPrivilegeAuthorityName

public byte[] getSASContextSecPrivilegeAuthorityName(int index,
                                                     int auth_index)
Return the name field of a privilege authority from the given security mechanism.

Parameters:
index - The index of the security mechanism for which to return a privilege authority.
auth_index - The index of the privilege authority to return.
Returns:
The content of ServiceConfiguration.name as byte array.

getSASContextSecSupportedNamingMechanismsCount

public int getSASContextSecSupportedNamingMechanismsCount(int index)
Return the number of supported naming mechanisms for the specified security mechanism.

Parameters:
index - The index of the security mechanism for which to return the number of privilege authorities.
Returns:
The number of supported naming mechanisms or -1 when the CompoundSecMechList member of this class has not been set.

getSASContextSecSupportedNamingMechanism

public byte[] getSASContextSecSupportedNamingMechanism(int index,
                                                       int mech_index)
Return a supported naming mechanism from the given security mechanism.

Parameters:
index - The index of the security mechanism for which to return a privilege authority.
mech_index - The index of the naming mechanism to return.
Returns:
A byte array with the supported naming mechanism.

getSASContextSecSupportedNamingMechanismString

public java.lang.String getSASContextSecSupportedNamingMechanismString(int index,
                                                                       int mech_index)
Return a stringified representation of the supported naming mechanism from the given security mechanism.

Parameters:
index - The index of the security mechanism for which to return a privilege authority.
mech_index - The index of the naming mechanism to return.
Returns:
A String with the oid of the supported naming mechanism.

getSASContextSecSupportedIdentityTypes

public int getSASContextSecSupportedIdentityTypes(int index)
Return the supported identity types from the given security mechanism.

Parameters:
index - The index of the security mechanism for which to return a privilege authority.
Returns:
An integer containing the supported identity types.

getSASContextSecSupportedIdentityTypesString

public java.lang.String getSASContextSecSupportedIdentityTypesString(int index)
Return a stringified representation of the supported identity types from the given security mechanism.

Parameters:
index - The index of the security mechanism for which to return a privilege authority.
Returns:
A string describing the supported identity types.

toString

public java.lang.String toString()
This method creates a stringified representation of the CompoundSecMechList class.

Overrides:
toString in class java.lang.Object
Returns:
A stringified respresentation of CompoundSecMechList.