All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class orbasec.corba.CredUtil

java.lang.Object
   |
   +----orbasec.corba.CredUtil

public class CredUtil
extends Object
This class contains a number of static methods for dealing with the CORBA Security Level 2 Credentials Object and its attributes.


Variable Index

 o Both
The following constants shorten the names for org.omg.Security.CommunicationDirection enum members.
 o Reply
The following constants shorten the names for org.omg.Security.CommunicationDirection enum members.
 o Request
The following constants shorten the names for org.omg.Security.CommunicationDirection enum members.
 o SecCompDelegation
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.
 o SecConfidentiality
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.
 o SecDetectMisordering
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.
 o SecDetectReplay
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.
 o SecIntegAndConf
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.
 o SecIntegrity
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.
 o SecNoDelegation
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.
 o SecNoProtection
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.
 o SecSimpleDelegation
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.
 o SecTrustInClient
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.
 o SecTrustInTarget
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.

Constructor Index

 o CredUtil()

Method Index

 o adjust_unsigned_long(int)
This function turns the CORBA java mapping of an unsigned long and turns it into a java long.
 o adjust_unsigned_short(short)
This function turns the CORBA java mapping of an unsigned short and turns it into a java int.
 o associationOptionsToDelegationMode(short)
Returns the DelegationMode implied by the given Security::AssociationOptions.
 o associationOptionsToEstablishTrust(short)
Returns the EstablishTrust implied by the given Security::AssociationOptions.
 o associationOptionsToQOP(short)
Returns the QOP implied by the given Security::AssociationOptions.
 o copyAttributeType(AttributeType)
Deep copy of a Security::AttributeType.
 o copyCredentialsList(Credentials[])
Quasi-Deep copy (at least to the specification of the Vault) of a credentials list.
 o copyOpaque(byte[])
Copy of Security::Opaque
 o copySecAttribute(SecAttribute)
Deep copy of Security::SecAttribute Structure.
 o copySecAttributeList(SecAttribute[])
Deep copy of Security::AttributeList
 o credsInList(Credentials, Credentials[])
Returns true if the Credentials object is in the CredentialsList.
 o delegationModeToAssociationOptions(DelegationMode)
Converts DelegationMode to Security::AssociationOptions
 o dumpCredentialFeatures(PrintWriter, Credentials)
 o dumpCredentials(Credentials)
Prints the Credentials to a System.out.
 o dumpCredentials(Credentials[])
Prints the CredentialsList to a System.out.
 o dumpCredentials(PrintStream, Credentials)
Prints the Credentials to a PrintStream.
 o dumpCredentials(PrintStream, Credentials[])
Prints the CredentialsList to a PrintStream.
 o dumpCredentials(PrintWriter, Credentials)
Turns the Credential into a readable string on a PrintWriter.
 o dumpCredentials(PrintWriter, Credentials, boolean)
Turns the Credential into a readable string on a PrintWriter.
 o dumpCredentials(PrintWriter, Credentials[])
Prints the CredentialsList to a PrintStream.
 o dumpCredentials(PrintWriter, String, Credentials, boolean)
Turns the Credential into a readable string on a PrintWriter.
 o dumpSecAttribute(PrintWriter, SecAttribute)
Converts a SecAttribute to a string and writes it out on the PrintWriter.
 o equals(AttributeType, AttributeType)
Compares to Security::AttributeType structures.
 o equals(byte[], byte[])
Compares two Security::Opaques for equality
 o equals(ExtensibleFamily, ExtensibleFamily)
Compares to Security::ExensibleFamily structures
 o equals(SecAttribute, SecAttribute)
Compares two Security::SecAttribute structures.
 o equivalent(Credentials, Credentials)
This function determines if two credentials objects are "equivalent".
 o equivalent(SecAttribute[], SecAttribute[])
Effective determines if the two lists of SecAttributes are equivalent regardless of order.
 o equivalentAttributeLists(Vector, Vector)
Effectively determines whether the two list of sec attributes are equivalent regardless of order.
 o establishTrustToAssociationOptions(EstablishTrust)
Converts EstblishTrust to Security::AssociationOptions
 o find_credentials(Credentials[], String)
This call returns the credentials objects that support the given mechanism.
 o genAttributeType(int, int, int)
Generates a Security::AttributeType
 o genSecAttribute(AttributeType, byte[], byte[])
Generates a Security::SecAttribute Structure.
 o genSecAttribute(int, int, int, byte[], byte[])
Generates a Security::SecAttribute Structure.
 o genSecAttribute(int, int, int, String, String, String, String)
Generates a Security::SecAttribute Structure.
 o getAccessId(Credentials)
Retrieve the value portion of the first AccessId.
 o getAccessIdAttribute(Credentials)
Retreives the first AccessId attribute on the Credentials.
 o has(Credentials, SecAttribute)
Returns true if the SecAttribute is contained by the Credential object.
 o has(SecAttribute[], SecAttribute)
Returns true if the SecAttribute is contained by the AttributeList.
 o hasAll(Credentials, Vector)
Returns true if the Credentials contain all of the attributes in the vector.
 o hasAll(SecAttribute[], Vector)
Returns true if the attribute list contains all of the attributes in the vector.
 o hasAny(Credentials, Vector)
Returns true if the Credentials object has any of the SecAttributes in the vector.
 o hasAny(SecAttribute[], Vector)
Returns true if the attribute list has any of the attributes in the vector.
 o indexOf(SecAttribute, SecAttribute[])
Returns the index of the first SecAttributes in the AttributeList that matches the given SecAttribute.
 o indexOfAttribute(SecAttribute, Vector)
Returns the index of the first SecAttribute in the Vector of SecAttributes that matches the given SecAttribute.
 o isOwn(Credentials)
Returns true if this Credentials object is of the Own Credentials type.
 o isReceived(Credentials)
Returns true if this Credentials object is a ReceievedCredentials object.
 o isTarget(Credentials)
Returns true if this Credentials object is a TargetCredentials object.
 o lessThan(AttributeType, AttributeType)
Compares to Security::AttributeType structures for sorting by family definer, family, and then attribute type.
 o lessThan(ExtensibleFamily, ExtensibleFamily)
Compares to Security::AttributeType structures.
 o maxDelegation(short, short, short, short)
 o maxQOP(short, short, short, short)
 o maxTrust(short, short, short, short)
 o oneOf(SecAttribute, SecAttribute[])
Compares the first attribute to each of the attributes in the array of attributes.
 o opaque(String, String)
Creates an Security::Opaque value of either a java "String" or a "HexBin" type.
 o qopToAssociationOptions(QOP)
Converts QOP to Security::AssociationOptions
 o supportsDelegationDirective(Credentials, DelegationDirective)
Returns true if the Credentials supports the DelegationDirective
 o supportsMechanism(Credentials, String)
Returns true if the Credentials object supports the named mechanism.
 o supportsQOP(Credentials, QOP)
Returns true if the Credentials support the QOP.
 o supportsTrust(Credentials, boolean, boolean)
This function returns true if the credential supports the given trust configuration.
 o supportsTrust(Credentials, EstablishTrust)
This function returns true if the credentials supports the given trust configuration.
 o toString(Credentials)
This method dumps the credentials to a printable string.
 o toString(CredentialsType)
Returns symbolic name for the Credential type.
 o toString(DelegationDirective)
Symbolic name for the DelegationDirective.
 o toString(DelegationMode)
Returns symbolic name for an org.omg.Security.DelegationMode.
 o toString(DelegationState)
Symbolic name for the DelegationState.
 o toString(QOP)
Returns the symbolic name for the QOP.
 o toString(SecAttribute)
Converts a SecAttribute to a string using Name for the Opaque components.
 o toString(SecAttribute[])
Converts a list of SecAttribute to a string using seperation by '\n'
 o toString(short)
This method prints the Association Options out in a printable string.

Variables

 o Request
 public static final CommunicationDirection Request
The following constants shorten the names for org.omg.Security.CommunicationDirection enum members.

 o Reply
 public static final CommunicationDirection Reply
The following constants shorten the names for org.omg.Security.CommunicationDirection enum members.

 o Both
 public static final CommunicationDirection Both
The following constants shorten the names for org.omg.Security.CommunicationDirection enum members.

 o SecNoProtection
 public static final SecurityFeature SecNoProtection
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.

 o SecIntegrity
 public static final SecurityFeature SecIntegrity
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.

 o SecConfidentiality
 public static final SecurityFeature SecConfidentiality
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.

 o SecIntegAndConf
 public static final SecurityFeature SecIntegAndConf
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.

 o SecDetectReplay
 public static final SecurityFeature SecDetectReplay
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.

 o SecDetectMisordering
 public static final SecurityFeature SecDetectMisordering
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.

 o SecNoDelegation
 public static final SecurityFeature SecNoDelegation
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.

 o SecSimpleDelegation
 public static final SecurityFeature SecSimpleDelegation
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.

 o SecCompDelegation
 public static final SecurityFeature SecCompDelegation
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.

 o SecTrustInClient
 public static final SecurityFeature SecTrustInClient
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.

 o SecTrustInTarget
 public static final SecurityFeature SecTrustInTarget
The following constants shorten the names for org.omg.Security.SecurityFeature enum members.

Constructors

 o CredUtil
 public CredUtil()

Methods

 o opaque
 public static final byte[] opaque(String type,
                                   String value)
Creates an Security::Opaque value of either a java "String" or a "HexBin" type. HexBin is a Java String of hexadecimal characters that represent bytes.

Parameters:
type - "String" or "HexBin"
value - The value to convert.
Returns:
Converted Security Opaque Value.
 o equals
 public static final boolean equals(byte d1[],
                                    byte d2[])
Compares two Security::Opaques for equality

 o equals
 public static final boolean equals(ExtensibleFamily a,
                                    ExtensibleFamily b)
Compares to Security::ExensibleFamily structures

 o equals
 public static final boolean equals(AttributeType at1,
                                    AttributeType at2)
Compares to Security::AttributeType structures.

 o lessThan
 public static final boolean lessThan(ExtensibleFamily f1,
                                      ExtensibleFamily f2)
Compares to Security::AttributeType structures.

 o lessThan
 public static final boolean lessThan(AttributeType at1,
                                      AttributeType at2)
Compares to Security::AttributeType structures for sorting by family definer, family, and then attribute type.

 o equals
 public static final boolean equals(SecAttribute a,
                                    SecAttribute b)
Compares two Security::SecAttribute structures.

Note: the defining_authority attribute and the attribute value attribute each must match their counterpart exactly.

 o oneOf
 public static final boolean oneOf(SecAttribute a,
                                   SecAttribute attrs[])
Compares the first attribute to each of the attributes in the array of attributes. If it is equal to one of the attributes in the array this function returns true, otherwise false.

 o indexOf
 public static final int indexOf(SecAttribute a,
                                 SecAttribute attrs[])
Returns the index of the first SecAttributes in the AttributeList that matches the given SecAttribute. This function returns -1 if it cannot determine that the first attribute is in the array of attributes.

 o indexOfAttribute
 public static final int indexOfAttribute(SecAttribute a,
                                          Vector attrs)
Returns the index of the first SecAttribute in the Vector of SecAttributes that matches the given SecAttribute. This function returns -1 if it cannot determine that the first attribute is in the array of attributes.

 o equivalentAttributeLists
 public static final boolean equivalentAttributeLists(Vector as1,
                                                      Vector as2)
Effectively determines whether the two list of sec attributes are equivalent regardless of order. Pays attention to duplicates.

 o equivalent
 public static final boolean equivalent(SecAttribute as1[],
                                        SecAttribute as2[])
Effective determines if the two lists of SecAttributes are equivalent regardless of order. Pays attention to duplicates.

 o equivalent
 public static final boolean equivalent(Credentials c1,
                                        Credentials c2)
This function determines if two credentials objects are "equivalent". Credentials are equivalent if their string representation is equal. (We hope). It's the best we can do at this point. The definition of this function is:
 return (c1 == c2) || toString(c1).equals(toString(c2));
 

 o copyOpaque
 public static final byte[] copyOpaque(byte buf[])
Copy of Security::Opaque

 o copyAttributeType
 public static final AttributeType copyAttributeType(AttributeType at1)
Deep copy of a Security::AttributeType.

 o copySecAttribute
 public static final SecAttribute copySecAttribute(SecAttribute att)
Deep copy of Security::SecAttribute Structure.

 o copySecAttributeList
 public static final SecAttribute[] copySecAttributeList(SecAttribute atts[])
Deep copy of Security::AttributeList

 o copyCredentialsList
 public static final Credentials[] copyCredentialsList(Credentials creds[])
Quasi-Deep copy (at least to the specification of the Vault) of a credentials list. Calls Credentials.copy().

 o genAttributeType
 public static final AttributeType genAttributeType(int fam_definer,
                                                    int family,
                                                    int att_type)
Generates a Security::AttributeType

 o genSecAttribute
 public static final SecAttribute genSecAttribute(int fam_definer,
                                                  int family,
                                                  int att_type,
                                                  String da_type,
                                                  String da,
                                                  String val_type,
                                                  String val)
Generates a Security::SecAttribute Structure.

Parameters:
fam_definer - The Family Definer of the AttributeType.
family - The Family of the AttributeType.
att_type - The Type id of the AttributeType.
da_type - "String" or "HexBin" See opague(String,String)
da - The DefiningAuthority of SecAttribute
val_type - "String" or "HexBin" See opaque(String,String)
val - The String representing the value.
Returns:
The SecAttribute Structure.
 o genSecAttribute
 public static final SecAttribute genSecAttribute(int fam_definer,
                                                  int family,
                                                  int att_type,
                                                  byte da[],
                                                  byte val[])
Generates a Security::SecAttribute Structure.

Parameters:
fam_definer - The Family Definer of the AttributeType.
family - The Family of the AttributeType.
att_type - The Type id of the AttributeType.
da - The DefiningAuthority of SecAttribute
val - The value of the SecAttribute.
Returns:
The SecAttribute Structure.
 o genSecAttribute
 public static final SecAttribute genSecAttribute(AttributeType type,
                                                  byte da[],
                                                  byte val[])
Generates a Security::SecAttribute Structure.

Parameters:
type - The AttributeType.
da - The DefiningAuthority of SecAttribute
val - The value of the SecAttribute.
Returns:
The SecAttribute Structure.
 o hasAny
 public static final boolean hasAny(Credentials creds,
                                    Vector attributes)
Returns true if the Credentials object has any of the SecAttributes in the vector.

 o hasAny
 public static final boolean hasAny(SecAttribute attrs[],
                                    Vector attributes)
Returns true if the attribute list has any of the attributes in the vector.

 o has
 public static final boolean has(SecAttribute attrs[],
                                 SecAttribute attr)
Returns true if the SecAttribute is contained by the AttributeList. The comparison is done by using CredUtil.equals(SecAttribute,SecAttribute).

 o has
 public static final boolean has(Credentials creds,
                                 SecAttribute attr)
Returns true if the SecAttribute is contained by the Credential object. Done by using CredUtil.equals(SecAttribute,SecAttribute).

 o hasAll
 public static final boolean hasAll(Credentials creds,
                                    Vector attributes)
Returns true if the Credentials contain all of the attributes in the vector.

 o hasAll
 public static final boolean hasAll(SecAttribute attrs[],
                                    Vector attributes)
Returns true if the attribute list contains all of the attributes in the vector.

 o getAccessIdAttribute
 public static final SecAttribute getAccessIdAttribute(Credentials creds)
Retreives the first AccessId attribute on the Credentials.

 o getAccessId
 public static final byte[] getAccessId(Credentials creds)
Retrieve the value portion of the first AccessId.

Returns:
The byte array of the value oportion of the SecAttribute with the AttributeType of (0,1,2). If there is no attribute it returns a zero length byte array.
 o supportsMechanism
 public static final boolean supportsMechanism(Credentials creds,
                                               String mechanism)
Returns true if the Credentials object supports the named mechanism.

See Also:
mechSupportsMech
 o associationOptionsToQOP
 public static final QOP associationOptionsToQOP(short opts)
Returns the QOP implied by the given Security::AssociationOptions.

 o qopToAssociationOptions
 public static final short qopToAssociationOptions(QOP qop)
Converts QOP to Security::AssociationOptions

 o associationOptionsToDelegationMode
 public static final DelegationMode associationOptionsToDelegationMode(short opts)
Returns the DelegationMode implied by the given Security::AssociationOptions.

 o delegationModeToAssociationOptions
 public static final short delegationModeToAssociationOptions(DelegationMode qop)
Converts DelegationMode to Security::AssociationOptions

 o associationOptionsToEstablishTrust
 public static final EstablishTrust associationOptionsToEstablishTrust(short opts)
Returns the EstablishTrust implied by the given Security::AssociationOptions.

 o establishTrustToAssociationOptions
 public static final short establishTrustToAssociationOptions(EstablishTrust trust)
Converts EstblishTrust to Security::AssociationOptions

 o find_credentials
 public static final Credentials[] find_credentials(Credentials creds_list[],
                                                    String mechanism)
This call returns the credentials objects that support the given mechanism.

 o isReceived
 public static final boolean isReceived(Credentials creds)
Returns true if this Credentials object is a ReceievedCredentials object.

 o isTarget
 public static final boolean isTarget(Credentials creds)
Returns true if this Credentials object is a TargetCredentials object.

 o isOwn
 public static final boolean isOwn(Credentials creds)
Returns true if this Credentials object is of the Own Credentials type.

 o credsInList
 public static final boolean credsInList(Credentials creds,
                                         Credentials credslist[])
Returns true if the Credentials object is in the CredentialsList. This call uses a straight equals() call on the Credentials objects.

 o supportsQOP
 public static final boolean supportsQOP(Credentials creds,
                                         QOP qop)
Returns true if the Credentials support the QOP. It does this determination by checking the SecurityFeatures.

 o supportsDelegationDirective
 public static final boolean supportsDelegationDirective(Credentials creds,
                                                         DelegationDirective dir)
Returns true if the Credentials supports the DelegationDirective

 o supportsTrust
 public static final boolean supportsTrust(Credentials creds,
                                           boolean client_trust,
                                           boolean target_trust)
This function returns true if the credential supports the given trust configuration. The the trust feature is true, it must be supported by the credentials features. If the trust feature is false, it must not be required by invocation_options_required();

 o supportsTrust
 public static final boolean supportsTrust(Credentials creds,
                                           EstablishTrust trust)
This function returns true if the credentials supports the given trust configuration. If the trust feature is tru, it must be supported by the credentials features. If the trust feature is false, it must no be required by invocation_options_required().

 o adjust_unsigned_short
 public static int adjust_unsigned_short(short a)
This function turns the CORBA java mapping of an unsigned short and turns it into a java int. Turning an unsigned short into and int requires examining the short being negative and adjusting it to a positive number (2's complement).

 o adjust_unsigned_long
 public static long adjust_unsigned_long(int a)
This function turns the CORBA java mapping of an unsigned long and turns it into a java long. Turning an unsigned long into and long requires examining the short being negative and adjusting it to a positive number (2's complement).

 o toString
 public static final String toString(SecAttribute att)
Converts a SecAttribute to a string using Name for the Opaque components. Values are tried to be decoded by Opaque.decode(). If that fails, then a string representation of their Hexvalues are presented.
  SecAttribute(0,1,2,krbtgt/ADIRON.COM@ADIRON.COM,polar@ADIRON.COM)
 

 o toString
 public static final String toString(SecAttribute attrs[])
Converts a list of SecAttribute to a string using seperation by '\n'

 o dumpSecAttribute
 public static final void dumpSecAttribute(PrintWriter pw,
                                           SecAttribute att)
Converts a SecAttribute to a string and writes it out on the PrintWriter.

 o dumpCredentialFeatures
 public static final void dumpCredentialFeatures(PrintWriter pw,
                                                 Credentials c)
 o dumpCredentials
 public static final void dumpCredentials(PrintWriter pw,
                                          Credentials cred)
Turns the Credential into a readable string on a PrintWriter.

Parameters:
pw - The PrintWriter
cred - The Credentials Object
 o dumpCredentials
 public static final void dumpCredentials(PrintWriter pw,
                                          Credentials cred,
                                          boolean with_peer)
Turns the Credential into a readable string on a PrintWriter.

Parameters:
pw - The PrintWriter
cred - The Credentials Object
with_peer - Print the peer credentials if Credentials are of the Received Credentials type.
 o dumpCredentials
 public static final void dumpCredentials(PrintWriter pw,
                                          String hd,
                                          Credentials cred,
                                          boolean with_assoc)
Turns the Credential into a readable string on a PrintWriter.

Parameters:
pw - The PrintWriter
hd - The indentation string, prefixes each line.
cred - The Credentials Object
with_assoc - Print the associated credentials if Credentials are of the Received Credentials type.
 o dumpCredentials
 public static final void dumpCredentials(PrintWriter pw,
                                          Credentials creds[])
Prints the CredentialsList to a PrintStream.

 o dumpCredentials
 public static final void dumpCredentials(PrintStream out,
                                          Credentials creds)
Prints the Credentials to a PrintStream.

 o dumpCredentials
 public static final void dumpCredentials(PrintStream out,
                                          Credentials creds[])
Prints the CredentialsList to a PrintStream.

 o dumpCredentials
 public static final void dumpCredentials(Credentials creds)
Prints the Credentials to a System.out.

 o dumpCredentials
 public static final void dumpCredentials(Credentials creds[])
Prints the CredentialsList to a System.out.

 o toString
 public static final String toString(Credentials creds)
This method dumps the credentials to a printable string.

 o toString
 public static final String toString(short opts)
This method prints the Association Options out in a printable string.

 o toString
 public static final String toString(DelegationMode mode)
Returns symbolic name for an org.omg.Security.DelegationMode. One of :
  "SecDelModeNoDelegation"
  "SecDelModeSimpleDelegation"
  "SecDelModeCompositeDelegation"
 

 o toString
 public static final String toString(DelegationState state)
Symbolic name for the DelegationState. One of:
   SecInitiator
   SecDelegate
 

 o toString
 public static final String toString(CredentialsType type)
Returns symbolic name for the Credential type. One of:
   SecOwnCredentials
   SecReceivedCredentials
 

 o toString
 public static final String toString(QOP qop)
Returns the symbolic name for the QOP. One of:
   SecQOPNoProtection
   SecQOPIntegrity
   SecQOPConfidentiality
   SecQOPIntegrityAndConfidentiality
 

 o toString
 public static final String toString(DelegationDirective dir)
Symbolic name for the DelegationDirective. One of:
   NoDelegation
   Delegate
 

 o maxQOP
 public static final short maxQOP(short creds_supports,
                                  short creds_requires,
                                  short ior_supports,
                                  short ior_requires)
 o maxTrust
 public static final short maxTrust(short creds_supports,
                                    short creds_requires,
                                    short ior_supports,
                                    short ior_requires)
 o maxDelegation
 public static final short maxDelegation(short creds_supports,
                                         short creds_requires,
                                         short ior_supports,
                                         short ior_requires)

All Packages  Class Hierarchy  This Package  Previous  Next  Index