sun.security.mule.krb5
Class Realm

java.lang.Object
  extended by sun.security.mule.krb5.Realm
All Implemented Interfaces:
Cloneable

public class Realm
extends Object
implements Cloneable

Implements the ASN.1 Realm type.

Realm ::= GeneralString


Constructor Summary
Realm(sun.security.util.DerValue encoding)
          Constructs a Realm object.
Realm(String name)
           
 
Method Summary
 byte[] asn1Encode()
          Encodes a Realm object.
 Object clone()
           
 boolean equals(Object obj)
           
static String[] getRealmsList(String cRealm, String sRealm, Config kerberosConfig)
          Returns an array of realms that may be traversed to obtain a TGT from the initiating realm cRealm to the target realm sRealm.
 int hashCode()
           
protected static boolean isValidRealmString(String name)
           
static Realm parse(sun.security.util.DerInputStream data, byte explicitTag, boolean optional)
          Parse (unmarshal) a realm from a DER input stream.
protected static String parseRealm(String name)
           
static String parseRealmAtSeparator(String name)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Realm

public Realm(String name)
      throws RealmException
Throws:
RealmException

Realm

public Realm(sun.security.util.DerValue encoding)
      throws Asn1Exception,
             RealmException,
             IOException
Constructs a Realm object.

Parameters:
encoding - a Der-encoded data.
Throws:
Asn1Exception - if an error occurs while decoding an ASN1 encoded data.
IOException - if an I/O error occurs while reading encoded data.
RealmException - if an error occurs while parsing a Realm object.
Method Detail

clone

public Object clone()
Overrides:
clone in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

parseRealmAtSeparator

public static String parseRealmAtSeparator(String name)
                                    throws RealmException
Throws:
RealmException

parseRealm

protected static String parseRealm(String name)
                            throws RealmException
Throws:
RealmException

isValidRealmString

protected static boolean isValidRealmString(String name)

asn1Encode

public byte[] asn1Encode()
                  throws Asn1Exception,
                         IOException
Encodes a Realm object.

Returns:
the byte array of encoded KrbCredInfo object.
Throws:
Asn1Exception - if an error occurs while decoding an ASN1 encoded data.
IOException - if an I/O error occurs while reading encoded data.

parse

public static Realm parse(sun.security.util.DerInputStream data,
                          byte explicitTag,
                          boolean optional)
                   throws Asn1Exception,
                          IOException,
                          RealmException
Parse (unmarshal) a realm from a DER input stream. This form parsing might be used when expanding a value which is part of a constructed sequence and uses explicitly tagged type.

Parameters:
data - the Der input stream value, which contains one or more marshaled value.
explicitTag - tag number.
optional - indicate if this data field is optional
Returns:
an instance of Realm.
Throws:
Asn1Exception - on error.
IOException
RealmException

getRealmsList

public static String[] getRealmsList(String cRealm,
                                     String sRealm,
                                     Config kerberosConfig)
                              throws KrbException
Returns an array of realms that may be traversed to obtain a TGT from the initiating realm cRealm to the target realm sRealm.
There may be an arbitrary number of intermediate realms between cRealm and sRealm. The realms may be organized organized hierarchically, or the paths between them may be specified in the [capaths] stanza of the caller's Kerberos configuration file. The configuration file is consulted first. Then a hirarchical organization is assumed if no realms are found in the configuration file.
The returned list, if not null, contains cRealm as the first entry. sRealm is not included unless it is mistakenly listed in the configuration file as an intermediary realm.

Parameters:
cRealm - the initiating realm
sRealm - the target realm
Throws:
KrbException


Copyright © 2013. All Rights Reserved.