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.
-
Both
- The following constants shorten the names for
org.omg.Security.CommunicationDirection enum members.
-
Reply
- The following constants shorten the names for
org.omg.Security.CommunicationDirection enum members.
-
Request
- The following constants shorten the names for
org.omg.Security.CommunicationDirection enum members.
-
SecCompDelegation
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
-
SecConfidentiality
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
-
SecDetectMisordering
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
-
SecDetectReplay
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
-
SecIntegAndConf
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
-
SecIntegrity
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
-
SecNoDelegation
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
-
SecNoProtection
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
-
SecSimpleDelegation
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
-
SecTrustInClient
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
-
SecTrustInTarget
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
-
CredUtil()
-
-
adjust_unsigned_long(int)
- This function turns the CORBA java mapping of an unsigned long
and turns it into a java long.
-
adjust_unsigned_short(short)
- This function turns the CORBA java mapping of an unsigned short
and turns it into a java int.
-
associationOptionsToDelegationMode(short)
- Returns the DelegationMode implied by the given
Security::AssociationOptions.
-
associationOptionsToEstablishTrust(short)
- Returns the EstablishTrust implied by the given
Security::AssociationOptions.
-
associationOptionsToQOP(short)
- Returns the QOP implied by the given
Security::AssociationOptions.
-
copyAttributeType(AttributeType)
- Deep copy of a Security::AttributeType.
-
copyCredentialsList(Credentials[])
- Quasi-Deep copy (at least to the specification of the
Vault) of a credentials list.
-
copyOpaque(byte[])
- Copy of Security::Opaque
-
copySecAttribute(SecAttribute)
- Deep copy of Security::SecAttribute Structure.
-
copySecAttributeList(SecAttribute[])
- Deep copy of Security::AttributeList
-
credsInList(Credentials, Credentials[])
- Returns true if the Credentials object is in the CredentialsList.
-
delegationModeToAssociationOptions(DelegationMode)
- Converts DelegationMode to Security::AssociationOptions
-
dumpCredentialFeatures(PrintWriter, Credentials)
-
-
dumpCredentials(Credentials)
- Prints the Credentials to a System.out.
-
dumpCredentials(Credentials[])
- Prints the CredentialsList to a System.out.
-
dumpCredentials(PrintStream, Credentials)
- Prints the Credentials to a PrintStream.
-
dumpCredentials(PrintStream, Credentials[])
- Prints the CredentialsList to a PrintStream.
-
dumpCredentials(PrintWriter, Credentials)
-
Turns the Credential into a readable string on a PrintWriter.
-
dumpCredentials(PrintWriter, Credentials, boolean)
-
Turns the Credential into a readable string on a PrintWriter.
-
dumpCredentials(PrintWriter, Credentials[])
- Prints the CredentialsList to a PrintStream.
-
dumpCredentials(PrintWriter, String, Credentials, boolean)
-
Turns the Credential into a readable string on a PrintWriter.
-
dumpSecAttribute(PrintWriter, SecAttribute)
- Converts a SecAttribute to a string and writes it out on the
PrintWriter.
-
equals(AttributeType, AttributeType)
- Compares to Security::AttributeType structures.
-
equals(byte[], byte[])
- Compares two Security::Opaques for equality
-
equals(ExtensibleFamily, ExtensibleFamily)
- Compares to Security::ExensibleFamily structures
-
equals(SecAttribute, SecAttribute)
- Compares two Security::SecAttribute structures.
-
equivalent(Credentials, Credentials)
- This function determines if two credentials objects
are "equivalent".
-
equivalent(SecAttribute[], SecAttribute[])
- Effective determines if the two lists of SecAttributes are
equivalent regardless of order.
-
equivalentAttributeLists(Vector, Vector)
- Effectively determines whether the two list of sec attributes
are equivalent regardless of order.
-
establishTrustToAssociationOptions(EstablishTrust)
- Converts EstblishTrust to Security::AssociationOptions
-
find_credentials(Credentials[], String)
- This call returns the credentials objects that support the given
mechanism.
-
genAttributeType(int, int, int)
- Generates a Security::AttributeType
-
genSecAttribute(AttributeType, byte[], byte[])
- Generates a Security::SecAttribute Structure.
-
genSecAttribute(int, int, int, byte[], byte[])
- Generates a Security::SecAttribute Structure.
-
genSecAttribute(int, int, int, String, String, String, String)
- Generates a Security::SecAttribute Structure.
-
getAccessId(Credentials)
- Retrieve the value portion of the first AccessId.
-
getAccessIdAttribute(Credentials)
- Retreives the first AccessId attribute on the Credentials.
-
has(Credentials, SecAttribute)
- Returns true if the SecAttribute is contained by the Credential
object.
-
has(SecAttribute[], SecAttribute)
- Returns true if the SecAttribute is contained by the AttributeList.
-
hasAll(Credentials, Vector)
- Returns true if the Credentials contain all of the attributes
in the vector.
-
hasAll(SecAttribute[], Vector)
- Returns true if the attribute list contains all of the
attributes in the vector.
-
hasAny(Credentials, Vector)
- Returns true if the Credentials object has any of the
SecAttributes in the vector.
-
hasAny(SecAttribute[], Vector)
- Returns true if the attribute list has any of the
attributes in the vector.
-
indexOf(SecAttribute, SecAttribute[])
- Returns the index of the first SecAttributes in the AttributeList
that matches the given SecAttribute.
-
indexOfAttribute(SecAttribute, Vector)
- Returns the index of the first SecAttribute in the Vector
of SecAttributes
that matches the given SecAttribute.
-
isOwn(Credentials)
- Returns true if this Credentials object is of the Own Credentials
type.
-
isReceived(Credentials)
- Returns true if this Credentials object is a ReceievedCredentials
object.
-
isTarget(Credentials)
- Returns true if this Credentials object is a TargetCredentials
object.
-
lessThan(AttributeType, AttributeType)
- Compares to Security::AttributeType structures
for sorting by family definer, family, and then
attribute type.
-
lessThan(ExtensibleFamily, ExtensibleFamily)
- Compares to Security::AttributeType structures.
-
maxDelegation(short, short, short, short)
-
-
maxQOP(short, short, short, short)
-
-
maxTrust(short, short, short, short)
-
-
oneOf(SecAttribute, SecAttribute[])
- Compares the first attribute to each of the attributes
in the array of attributes.
-
opaque(String, String)
- Creates an Security::Opaque value of either
a java "String" or a "HexBin" type.
-
qopToAssociationOptions(QOP)
- Converts QOP to Security::AssociationOptions
-
supportsDelegationDirective(Credentials, DelegationDirective)
- Returns true if the Credentials supports the DelegationDirective
-
supportsMechanism(Credentials, String)
- Returns true if the Credentials object supports the
named mechanism.
-
supportsQOP(Credentials, QOP)
- Returns true if the Credentials support the QOP.
-
supportsTrust(Credentials, boolean, boolean)
- This function returns true if the credential supports the
given trust configuration.
-
supportsTrust(Credentials, EstablishTrust)
- This function returns true if the credentials supports the
given trust configuration.
-
toString(Credentials)
- This method dumps the credentials to a printable string.
-
toString(CredentialsType)
- Returns symbolic name for the Credential type.
-
toString(DelegationDirective)
- Symbolic name for the DelegationDirective.
-
toString(DelegationMode)
- Returns symbolic name for an org.omg.Security.DelegationMode.
-
toString(DelegationState)
- Symbolic name for the DelegationState.
-
toString(QOP)
- Returns the symbolic name for the QOP.
-
toString(SecAttribute)
- Converts a SecAttribute to a string using Name for
the Opaque components.
-
toString(SecAttribute[])
- Converts a list of SecAttribute to a string using seperation by '\n'
-
toString(short)
- This method prints the Association Options out in a
printable string.
Request
public static final CommunicationDirection Request
- The following constants shorten the names for
org.omg.Security.CommunicationDirection enum members.
Reply
public static final CommunicationDirection Reply
- The following constants shorten the names for
org.omg.Security.CommunicationDirection enum members.
Both
public static final CommunicationDirection Both
- The following constants shorten the names for
org.omg.Security.CommunicationDirection enum members.
SecNoProtection
public static final SecurityFeature SecNoProtection
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
SecIntegrity
public static final SecurityFeature SecIntegrity
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
SecConfidentiality
public static final SecurityFeature SecConfidentiality
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
SecIntegAndConf
public static final SecurityFeature SecIntegAndConf
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
SecDetectReplay
public static final SecurityFeature SecDetectReplay
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
SecDetectMisordering
public static final SecurityFeature SecDetectMisordering
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
SecNoDelegation
public static final SecurityFeature SecNoDelegation
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
SecSimpleDelegation
public static final SecurityFeature SecSimpleDelegation
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
SecCompDelegation
public static final SecurityFeature SecCompDelegation
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
SecTrustInClient
public static final SecurityFeature SecTrustInClient
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
SecTrustInTarget
public static final SecurityFeature SecTrustInTarget
- The following constants shorten the names for
org.omg.Security.SecurityFeature enum members.
CredUtil
public CredUtil()
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.
equals
public static final boolean equals(byte d1[],
byte d2[])
- Compares two Security::Opaques for equality
equals
public static final boolean equals(ExtensibleFamily a,
ExtensibleFamily b)
- Compares to Security::ExensibleFamily structures
equals
public static final boolean equals(AttributeType at1,
AttributeType at2)
- Compares to Security::AttributeType structures.
lessThan
public static final boolean lessThan(ExtensibleFamily f1,
ExtensibleFamily f2)
- Compares to Security::AttributeType structures.
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.
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.
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.
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.
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.
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.
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.
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));
copyOpaque
public static final byte[] copyOpaque(byte buf[])
- Copy of Security::Opaque
copyAttributeType
public static final AttributeType copyAttributeType(AttributeType at1)
- Deep copy of a Security::AttributeType.
copySecAttribute
public static final SecAttribute copySecAttribute(SecAttribute att)
- Deep copy of Security::SecAttribute Structure.
copySecAttributeList
public static final SecAttribute[] copySecAttributeList(SecAttribute atts[])
- Deep copy of Security::AttributeList
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().
genAttributeType
public static final AttributeType genAttributeType(int fam_definer,
int family,
int att_type)
- Generates a Security::AttributeType
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.
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.
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.
hasAny
public static final boolean hasAny(Credentials creds,
Vector attributes)
- Returns true if the Credentials object has any of the
SecAttributes in the vector.
hasAny
public static final boolean hasAny(SecAttribute attrs[],
Vector attributes)
- Returns true if the attribute list has any of the
attributes in the vector.
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).
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).
hasAll
public static final boolean hasAll(Credentials creds,
Vector attributes)
- Returns true if the Credentials contain all of the attributes
in the vector.
hasAll
public static final boolean hasAll(SecAttribute attrs[],
Vector attributes)
- Returns true if the attribute list contains all of the
attributes in the vector.
getAccessIdAttribute
public static final SecAttribute getAccessIdAttribute(Credentials creds)
- Retreives the first AccessId attribute on the Credentials.
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.
supportsMechanism
public static final boolean supportsMechanism(Credentials creds,
String mechanism)
- Returns true if the Credentials object supports the
named mechanism.
- See Also:
- mechSupportsMech
associationOptionsToQOP
public static final QOP associationOptionsToQOP(short opts)
- Returns the QOP implied by the given
Security::AssociationOptions.
qopToAssociationOptions
public static final short qopToAssociationOptions(QOP qop)
- Converts QOP to Security::AssociationOptions
associationOptionsToDelegationMode
public static final DelegationMode associationOptionsToDelegationMode(short opts)
- Returns the DelegationMode implied by the given
Security::AssociationOptions.
delegationModeToAssociationOptions
public static final short delegationModeToAssociationOptions(DelegationMode qop)
- Converts DelegationMode to Security::AssociationOptions
associationOptionsToEstablishTrust
public static final EstablishTrust associationOptionsToEstablishTrust(short opts)
- Returns the EstablishTrust implied by the given
Security::AssociationOptions.
establishTrustToAssociationOptions
public static final short establishTrustToAssociationOptions(EstablishTrust trust)
- Converts EstblishTrust to Security::AssociationOptions
find_credentials
public static final Credentials[] find_credentials(Credentials creds_list[],
String mechanism)
- This call returns the credentials objects that support the given
mechanism.
isReceived
public static final boolean isReceived(Credentials creds)
- Returns true if this Credentials object is a ReceievedCredentials
object.
isTarget
public static final boolean isTarget(Credentials creds)
- Returns true if this Credentials object is a TargetCredentials
object.
isOwn
public static final boolean isOwn(Credentials creds)
- Returns true if this Credentials object is of the Own Credentials
type.
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.
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.
supportsDelegationDirective
public static final boolean supportsDelegationDirective(Credentials creds,
DelegationDirective dir)
- Returns true if the Credentials supports the DelegationDirective
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();
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().
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).
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).
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)
toString
public static final String toString(SecAttribute attrs[])
- Converts a list of SecAttribute to a string using seperation by '\n'
dumpSecAttribute
public static final void dumpSecAttribute(PrintWriter pw,
SecAttribute att)
- Converts a SecAttribute to a string and writes it out on the
PrintWriter.
dumpCredentialFeatures
public static final void dumpCredentialFeatures(PrintWriter pw,
Credentials c)
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
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.
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.
dumpCredentials
public static final void dumpCredentials(PrintWriter pw,
Credentials creds[])
- Prints the CredentialsList to a PrintStream.
dumpCredentials
public static final void dumpCredentials(PrintStream out,
Credentials creds)
- Prints the Credentials to a PrintStream.
dumpCredentials
public static final void dumpCredentials(PrintStream out,
Credentials creds[])
- Prints the CredentialsList to a PrintStream.
dumpCredentials
public static final void dumpCredentials(Credentials creds)
- Prints the Credentials to a System.out.
dumpCredentials
public static final void dumpCredentials(Credentials creds[])
- Prints the CredentialsList to a System.out.
toString
public static final String toString(Credentials creds)
- This method dumps the credentials to a printable string.
toString
public static final String toString(short opts)
- This method prints the Association Options out in a
printable string.
toString
public static final String toString(DelegationMode mode)
- Returns symbolic name for an org.omg.Security.DelegationMode.
One of :
"SecDelModeNoDelegation"
"SecDelModeSimpleDelegation"
"SecDelModeCompositeDelegation"
toString
public static final String toString(DelegationState state)
- Symbolic name for the DelegationState. One of:
SecInitiator
SecDelegate
toString
public static final String toString(CredentialsType type)
- Returns symbolic name for the Credential type. One of:
SecOwnCredentials
SecReceivedCredentials
toString
public static final String toString(QOP qop)
- Returns the symbolic name for the QOP. One of:
SecQOPNoProtection
SecQOPIntegrity
SecQOPConfidentiality
SecQOPIntegrityAndConfidentiality
toString
public static final String toString(DelegationDirective dir)
- Symbolic name for the DelegationDirective. One of:
NoDelegation
Delegate
maxQOP
public static final short maxQOP(short creds_supports,
short creds_requires,
short ior_supports,
short ior_requires)
maxTrust
public static final short maxTrust(short creds_supports,
short creds_requires,
short ior_supports,
short ior_requires)
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