sun.security.mule.krb5.internal
Class HostAddresses

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

public class HostAddresses
extends Object
implements Cloneable

Implements the ASN.1 HostAddresses type.

HostAddresses -- NOTE: subtly different from rfc1510, -- but has a value mapping and encodes the same ::= SEQUENCE OF HostAddress HostAddress ::= SEQUENCE { addr-type [0] Int32, address [1] OCTET STRING }

This definition reflects the Network Working Group RFC 4120 specification available at http://www.ietf.org/rfc/rfc4120.txt.


Constructor Summary
HostAddresses()
           
HostAddresses(sun.security.util.DerValue encoding)
          Constructs a new HostAddresses object.
HostAddresses(HostAddress[] new_addresses)
           
HostAddresses(InetAddress[] inetAddresses)
          Creates a new HostAddresses instance from the supplied list of InetAddresses.
HostAddresses(PrincipalName serverPrincipal)
           
 
Method Summary
 byte[] asn1Encode()
          Encodes a HostAddresses object.
 Object clone()
           
 boolean equals(Object obj)
           
 InetAddress[] getInetAddresses()
           
static HostAddresses getLocalAddresses()
          Returns all the IP addresses of the local host.
 int hashCode()
           
 boolean inList(HostAddress addr)
           
static HostAddresses parse(sun.security.util.DerInputStream data, byte explicitTag, boolean optional)
          Parse (unmarshal) a HostAddresses from a DER input stream.
 void writeAddrs(CCacheOutputStream cos)
          Writes data field values in HostAddresses in FCC format to a CCacheOutputStream.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HostAddresses

public HostAddresses(HostAddress[] new_addresses)
              throws IOException
Throws:
IOException

HostAddresses

public HostAddresses()
              throws UnknownHostException
Throws:
UnknownHostException

HostAddresses

public HostAddresses(PrincipalName serverPrincipal)
              throws UnknownHostException,
                     KrbException
Throws:
UnknownHostException
KrbException

HostAddresses

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

Parameters:
encoding - a single DER-encoded value.
Throws:
Asn1Exception - if an error occurs while decoding an ASN1 encoded data.
IOException - if an I/O error occurs while reading encoded data.

HostAddresses

public HostAddresses(InetAddress[] inetAddresses)
Creates a new HostAddresses instance from the supplied list of InetAddresses.

Method Detail

clone

public Object clone()
Overrides:
clone in class Object

inList

public boolean inList(HostAddress addr)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

asn1Encode

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

Returns:
byte array of encoded HostAddresses 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 HostAddresses parse(sun.security.util.DerInputStream data,
                                  byte explicitTag,
                                  boolean optional)
                           throws Asn1Exception,
                                  IOException
Parse (unmarshal) a HostAddresses 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 - indicates if this data field is optional.
Returns:
an instance of HostAddresses.
Throws:
Asn1Exception - if an Asn1Exception occurs.
IOException

writeAddrs

public void writeAddrs(CCacheOutputStream cos)
                throws IOException
Writes data field values in HostAddresses in FCC format to a CCacheOutputStream.

Parameters:
cos - a CCacheOutputStream to be written to.
Throws:
IOException - if an I/O exception occurs.
See Also:
CCacheOutputStream

getInetAddresses

public InetAddress[] getInetAddresses()

getLocalAddresses

public static HostAddresses getLocalAddresses()
                                       throws IOException
Returns all the IP addresses of the local host.

Throws:
IOException


Copyright © 2013. All Rights Reserved.