Class IPAddressName

    • Constructor Summary

      Constructors 
      Constructor Description
      IPAddressName​(byte[] address)
      Create the IPAddressName object with the specified name.
      IPAddressName​(java.lang.String s)
      Create the IPAddressName object with a string representing the ip address.
      IPAddressName​(java.lang.String s, java.lang.String netmask)
      Create the IPAddressName object with a string representing the ip address and a string representing the netmask, with encoding having ip address encoding followed by the netmask encoding.
      IPAddressName​(java.lang.String s, CIDRNetmask mask)
      IP address with CIDR netmask
      IPAddressName​(DerValue derValue)
      Create the IPAddressName object from the passed encoded Der value.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void encode​(DerOutputStream out)
      Encode the IPAddress name into the DerOutputStream.
      static int fillIPv4Address​(java.lang.String s, byte[] address, int start)
      Gets an IP v4 address in the form n.n.n.n.
      static int fillIPv6Address​(java.lang.String s, byte[] address, int start)
      Gets an IP address in the forms as defined in RFC1884:
      x:x:x:x:x:x:x:x ...::xxx (using :: shorthand) ...:n.n.n.n (with n.n.n.n at the end)
      int getType()
      Return the type of the GeneralName.
      java.lang.String toString()
      Return a printable string of IPaddress
      boolean validSingle()
      Whether the name is valid as a single name (e.g.
      boolean validSubtree()
      Whether the name is valid as a subtree name (e.g.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • IPAddressName

        public IPAddressName​(DerValue derValue)
                      throws java.io.IOException
        Create the IPAddressName object from the passed encoded Der value.
        Parameters:
        derValue - the encoded DER IPAddressName.
        Throws:
        java.io.IOException - on error.
      • IPAddressName

        public IPAddressName​(byte[] address)
        Create the IPAddressName object with the specified name.
        Parameters:
        name - the IPAddressName.
      • IPAddressName

        public IPAddressName​(java.lang.String s,
                             java.lang.String netmask)
        Create the IPAddressName object with a string representing the ip address and a string representing the netmask, with encoding having ip address encoding followed by the netmask encoding. This form is needed for name constraints extension.
        Parameters:
        s - the ip address in the format: n.n.n.n or x:x:x:x:x:x:x:x (RFC 1884)
        netmask - the netmask address in the format: n.n.n.n or x:x:x:x:x:x:x:x (RFC 1884)
      • IPAddressName

        public IPAddressName​(java.lang.String s,
                             CIDRNetmask mask)
        IP address with CIDR netmask
        Parameters:
        s - a single IPv4 or IPv6 address
        mask - a CIDR netmask
      • IPAddressName

        public IPAddressName​(java.lang.String s)
        Create the IPAddressName object with a string representing the ip address.
        Parameters:
        s - the ip address in the format: n.n.n.n or x:x:x:x:x:x:x:x
    • Method Detail

      • validSingle

        public boolean validSingle()
        Description copied from interface: GeneralNameInterface
        Whether the name is valid as a single name (e.g. for use in Subject Alternative Name extension).
        Specified by:
        validSingle in interface GeneralNameInterface
      • encode

        public void encode​(DerOutputStream out)
                    throws java.io.IOException
        Encode the IPAddress name into the DerOutputStream.
        Specified by:
        encode in interface GeneralNameInterface
        Parameters:
        out - the DER stream to encode the IPAddressName to.
        Throws:
        java.io.IOException - on encoding errors.
      • toString

        public java.lang.String toString()
        Return a printable string of IPaddress
        Overrides:
        toString in class java.lang.Object
      • fillIPv4Address

        public static int fillIPv4Address​(java.lang.String s,
                                          byte[] address,
                                          int start)
        Gets an IP v4 address in the form n.n.n.n.
      • fillIPv6Address

        public static int fillIPv6Address​(java.lang.String s,
                                          byte[] address,
                                          int start)
        Gets an IP address in the forms as defined in RFC1884:
        • x:x:x:x:x:x:x:x
        • ...::xxx (using :: shorthand)
        • ...:n.n.n.n (with n.n.n.n at the end)