public class

HostAddress

extends Object
implements Cloneable
java.lang.Object
   ↳ sun.security.mule.krb5.internal.HostAddress

Class Overview

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.

Summary

Fields
private static final boolean DEBUG
int addrType
byte[] address
private int hashCode
private static InetAddress localInetAddress
Public Constructors
HostAddress()
HostAddress(int new_addrType, byte[] new_address)
Creates a HostAddress from the specified address and address type.
HostAddress(InetAddress inetAddress)
HostAddress(DerValue encoding)
Constructs a host address from a single DER-encoded value.
Public Methods
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(DerInputStream data, byte explicitTag, boolean optional)
Parses (unmarshal) a host address from a DER input stream.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private static final boolean DEBUG

int addrType

byte[] address

private int hashCode

private static InetAddress localInetAddress

Public Constructors

public HostAddress ()

Throws
UnknownHostException

public HostAddress (int new_addrType, byte[] new_address)

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

public HostAddress (InetAddress inetAddress)

Parameters
inetAddress

public HostAddress (DerValue encoding)

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.

Public Methods

public byte[] asn1Encode ()

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.

public Object clone ()

public boolean equals (Object obj)

Parameters
obj

public InetAddress getInetAddress ()

Gets the InetAddress of this HostAddress.

Returns
  • the IP address for this specified host.
Throws
UnknownHostException

public int hashCode ()

public static HostAddress parse (DerInputStream data, byte explicitTag, boolean optional)

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.