sun.security.mule.krb5.internal
Class HostAddress

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

public class HostAddress
extends Object
implements Cloneable

Implements the ASN.1 HostAddress type.

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
HostAddress()
           
HostAddress(sun.security.util.DerValue encoding)
          Constructs a host address from a single DER-encoded value.
HostAddress(InetAddress inetAddress)
           
HostAddress(int new_addrType, byte[] new_address)
          Creates a HostAddress from the specified address and address type.
 
Method Summary
 byte[] asn1Encode()
          Encodes a HostAddress object.
 Object clone()
           
 boolean equals(Object obj)
           
 InetAddress getInetAddress()
          Gets the InetAddress of this HostAddress.
 int hashCode()
           
static HostAddress parse(sun.security.util.DerInputStream data, byte explicitTag, boolean optional)
          Parses (unmarshal) a host address from a DER input stream.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HostAddress

public HostAddress()
            throws UnknownHostException
Throws:
UnknownHostException

HostAddress

public HostAddress(int new_addrType,
                   byte[] new_address)
            throws KrbApErrException,
                   UnknownHostException
Creates a HostAddress from the specified address and address type.

Parameters:
new_addrType - the value of the address type which matches the defined address family constants in the Berkeley Standard Distributions of Unix.
new_address - network address.
Throws:
KrbApErrException - if address type and address length do not match defined value.
UnknownHostException

HostAddress

public HostAddress(InetAddress inetAddress)

HostAddress

public HostAddress(sun.security.util.DerValue encoding)
            throws Asn1Exception,
                   IOException
Constructs a host address from a single DER-encoded value.

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.
Method Detail

clone

public Object clone()
Overrides:
clone in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

getInetAddress

public InetAddress getInetAddress()
                           throws UnknownHostException
Gets the InetAddress of this HostAddress.

Returns:
the IP address for this specified host.
Throws:
if - no IP address for the host could be found.
UnknownHostException

asn1Encode

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

Returns:
a byte array of encoded HostAddress 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 HostAddress parse(sun.security.util.DerInputStream data,
                                byte explicitTag,
                                boolean optional)
                         throws Asn1Exception,
                                IOException
Parses (unmarshal) a host address 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 HostAddress.
Throws:
Asn1Exception - on error.
IOException - if an I/O error occurs while reading encoded data.


Copyright © 2013. All Rights Reserved.