com.ibm.security.krb5.internal
Class HostAddress
- java.lang.Object
com.ibm.security.krb5.internal.HostAddress
All implemented interfaces:
java.lang.Cloneable
- public class HostAddress
- extends java.lang.Object
- implements java.lang.Cloneable
This definition reflects the Network Working Group RFC 1510 specifications dated September 1993 and available at http://www.ietf.org/rfc/rfc1510.txt.
Field Summary
Modifier and Type | Field and Description |
---|---|
|
address
|
|
addrType
|
Constructor Summary
Constructor and Description |
---|
HostAddress()
|
HostAddress(com.ibm.security.util.DerValue encoding)
Constructs a host address from a single DER-encoded value.
|
HostAddress(java.net.InetAddress inetAddress)
|
HostAddress(int new_addrType,byte[] new_address)
Creates a HostAddress from the specified address and address type.
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
asn1Encode()
Encodes a HostAddress object.
|
|
clone()
|
|
equals(HostAddress h)
|
|
getInetAddress()
Gets the InetAddress of this HostAddress.
|
|
getLocalInetAddress()
|
|
parse(com.ibm.security.util.DerInputStream data,byte explicitTag,boolean optional)
Parses (unmarshal) a host address from a DER input stream.
|
|
refreshLocalInetAddress()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail
addrType
- public int addrType
address
- public byte[] address
Constructor Detail
HostAddress
- public HostAddress()
- throws java.net.UnknownHostException
Throws:
java.net.UnknownHostException
HostAddress
- public HostAddress(int new_addrType,
- byte[] new_address)
- throws KrbApErrException
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. HostAddress
- public HostAddress(java.net.InetAddress inetAddress)
HostAddress
- public HostAddress(com.ibm.security.util.DerValue encoding)
- throws Asn1Exception
- java.io.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. java.io.IOException
- if an I/O error occurs while reading encoded data. Method Detail
clone
- public java.lang.Object clone()
Overrides:
clone
in class java.lang.Object
equals
- public boolean equals(HostAddress h)
refreshLocalInetAddress
- public static void refreshLocalInetAddress( )
- throws java.net.UnknownHostException
Throws:
java.net.UnknownHostException
getLocalInetAddress
- public static byte[] getLocalInetAddress( )
- throws java.net.UnknownHostException
Throws:
java.net.UnknownHostException
getInetAddress
- public java.net.InetAddress getInetAddress( )
- throws java.net.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. java.net.UnknownHostException
asn1Encode
- public byte[] asn1Encode()
- throws Asn1Exception
- java.io.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. java.io.IOException
- if an I/O error occurs while reading encoded data. parse
- public static HostAddress parse( com.ibm.security.util.DerInputStream data,
- byte explicitTag,
- boolean optional)
- throws Asn1Exception
- java.io.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. java.io.IOException
- if an I/O error occurs while reading encoded data.