com.ibm.security.krb5.internal

Class HostAddress

  1. java.lang.Object
  2. extended bycom.ibm.security.krb5.internal.HostAddress
All implemented interfaces:
java.lang.Cloneable

  1. public class HostAddress
  2. extends java.lang.Object
  3. implements java.lang.Cloneable
Implements the ASN.1 HostAddress type. HostAddress ::= SEQUENCE { addr-type[0] INTEGER, address[1] OCTET STRING }

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
  1. byte[]
address
  1. int
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
  1. byte[]
asn1Encode()
Encodes a HostAddress object.
  1. java.lang.Object
clone()
  1. boolean
equals(HostAddress h)
  1. java.net.InetAddress
getInetAddress()
Gets the InetAddress of this HostAddress.
  1. static
  2. byte[]
getLocalInetAddress()
  1. static
  2. HostAddress
parse(com.ibm.security.util.DerInputStream data,byte explicitTag,boolean optional)
Parses (unmarshal) a host address from a DER input stream.
  1. static
  2. void
refreshLocalInetAddress()
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

addrType

  1. public int addrType

address

  1. public byte[] address

Constructor Detail

HostAddress

  1. public HostAddress()
  2. throws java.net.UnknownHostException
Throws:
java.net.UnknownHostException

HostAddress

  1. public HostAddress(int new_addrType,
  2. byte[] new_address)
  3. 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

  1. public HostAddress(java.net.InetAddress inetAddress)

HostAddress

  1. public HostAddress(com.ibm.security.util.DerValue encoding)
  2. throws Asn1Exception
  3. 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

  1. public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

equals

  1. public boolean equals(HostAddress h)

refreshLocalInetAddress

  1. public static void refreshLocalInetAddress( )
  2. throws java.net.UnknownHostException
Throws:
java.net.UnknownHostException

getLocalInetAddress

  1. public static byte[] getLocalInetAddress( )
  2. throws java.net.UnknownHostException
Throws:
java.net.UnknownHostException

getInetAddress

  1. public java.net.InetAddress getInetAddress( )
  2. 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

  1. public byte[] asn1Encode()
  2. throws Asn1Exception
  3. 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

  1. public static HostAddress parse( com.ibm.security.util.DerInputStream data,
  2. byte explicitTag,
  3. boolean optional)
  4. throws Asn1Exception
  5. 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.