java.lang.Object
org.shredzone.acme4j.Identifier
- All Implemented Interfaces:
Serializable
Represents an identifier.
The ACME protocol only defines the DNS identifier, which identifies a domain name. acme4j also supports IP identifiers.
CAs may define further, proprietary identifier types.
- Since:
- 2.3
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionIdentifier
(String type, String value) Creates a newIdentifier
.Identifier
(JSON json) Creates a newIdentifier
from the givenJSON
structure. -
Method Summary
Modifier and TypeMethodDescriptionstatic Identifier
Creates a new DNS identifier for the given domain name.boolean
Returns the domain name if this is a DNS identifier.getIP()
Returns the IP address if this is an IP identifier.getType()
Returns the identifier type.getValue()
Returns the identifier value.int
hashCode()
static Identifier
Creates a new IP identifier for the givenInetAddress
.static Identifier
ip
(InetAddress ip) Creates a new IP identifier for the givenInetAddress
.toMap()
Returns the identifier as JSON map.toString()
-
Field Details
-
TYPE_DNS
Type constant for DNS identifiers.- See Also:
-
TYPE_IP
Type constant for IP identifiers.- See Also:
-
-
Constructor Details
-
Identifier
Creates a newIdentifier
.This is a generic constructor for identifiers. Refer to the documentation of your CA to find out about the accepted identifier types and values.
Note that for DNS identifiers, no ASCII encoding of unicode domain takes place here. Use
dns(String)
instead.- Parameters:
type
- Identifier typevalue
- Identifier value
-
Identifier
Creates a newIdentifier
from the givenJSON
structure.- Parameters:
json
-JSON
containing the identifier data
-
-
Method Details
-
dns
Creates a new DNS identifier for the given domain name.- Parameters:
domain
- Domain name. Unicode domains are automatically ASCII encoded.- Returns:
- New
Identifier
-
ip
Creates a new IP identifier for the givenInetAddress
.- Parameters:
ip
-InetAddress
- Returns:
- New
Identifier
-
ip
Creates a new IP identifier for the givenInetAddress
.- Parameters:
ip
- IP address asString
- Returns:
- New
Identifier
- Since:
- 2.7
-
getType
Returns the identifier type. -
getValue
Returns the identifier value. -
getDomain
Returns the domain name if this is a DNS identifier.- Returns:
- Domain name. Unicode domains are ASCII encoded.
- Throws:
AcmeProtocolException
- if this is not a DNS identifier.
-
getIP
Returns the IP address if this is an IP identifier.- Returns:
InetAddress
- Throws:
AcmeProtocolException
- if this is not a DNS identifier.
-
toMap
Returns the identifier as JSON map. -
toString
-
equals
-
hashCode
-