public class HostTxtEntry extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_ADDDEST |
static String |
ACTION_ADDNAME |
static String |
ACTION_ADDSUBDOMAIN |
static String |
ACTION_CHANGEDEST |
static String |
ACTION_CHANGENAME |
static String |
ACTION_REMOVE |
static String |
ACTION_REMOVEALL |
static String |
ACTION_UPDATE |
static char |
KV_SEPARATOR |
static String |
PROP_ACTION |
static String |
PROP_DATE |
static String |
PROP_DEST |
static String |
PROP_EXPIRES |
static String |
PROP_NAME |
static String |
PROP_OLDDEST |
static String |
PROP_OLDNAME |
static String |
PROP_OLDSIG |
static char |
PROP_SEPARATOR |
static String |
PROP_SIG |
static String |
PROPS_SEPARATOR |
Constructor and Description |
---|
HostTxtEntry(String sprops)
A 'remove' entry.
|
HostTxtEntry(String name,
String dest)
Properties will be null
|
HostTxtEntry(String name,
String dest,
OrderedProperties props) |
HostTxtEntry(String name,
String dest,
String sprops) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Compares Destination only, not properties
|
String |
getDest() |
String |
getName() |
OrderedProperties |
getProps() |
int |
hashCode() |
boolean |
hasValidInnerSig()
Verify with the "olddest" property's public key using the "oldsig" property
|
boolean |
hasValidRemoveSig()
Verify with the "dest" property's public key using the "sig" property
|
boolean |
hasValidSig()
Verify with the dest public key using the "sig" property
|
void |
sign(SigningPrivateKey spk)
Sign and set the "sig" property
Must have been constructed with non-null properties.
|
void |
signInner(SigningPrivateKey spk)
Sign and set the "oldsig" property
Must have been constructed with non-null properties.
|
void |
signRemove(SigningPrivateKey spk)
Sign as a "remove" line #!dest=dest#name=name#k1=v1#sig=sig...]
Must have been constructed with non-null properties.
|
void |
write(BufferedWriter out)
Write as a standard line name=dest[#!k1=v1#k2=v2...]
Includes newline.
|
void |
write(Writer out)
Write as a standard line name=dest[#!k1=v1#k2=v2...]
Does not include newline.
|
void |
writeProps(Writer out)
Write the props part (if any) only, without newline
|
void |
writeRemove(Writer out)
Write as a "remove" line #!dest=dest#name=name#k1=v1#sig=sig...]
This works whether constructed with name and dest, or just properties.
|
void |
writeRemoveLine(BufferedWriter out)
Write as a "remove" line #!dest=dest#name=name#k1=v1#sig=sig...]
This works whether constructed with name and dest, or just properties.
|
public static final char KV_SEPARATOR
public static final String PROPS_SEPARATOR
public static final char PROP_SEPARATOR
public static final String PROP_ACTION
public static final String PROP_DATE
public static final String PROP_DEST
public static final String PROP_EXPIRES
public static final String PROP_NAME
public static final String PROP_OLDDEST
public static final String PROP_OLDNAME
public static final String PROP_OLDSIG
public static final String PROP_SIG
public static final String ACTION_ADDDEST
public static final String ACTION_ADDNAME
public static final String ACTION_ADDSUBDOMAIN
public static final String ACTION_CHANGEDEST
public static final String ACTION_CHANGENAME
public static final String ACTION_REMOVE
public static final String ACTION_REMOVEALL
public static final String ACTION_UPDATE
public HostTxtEntry(String name, String dest, String sprops) throws IllegalArgumentException
sprops
- line part after the #!, non-nullIllegalArgumentException
- on dup key in sprops and other errorspublic HostTxtEntry(String sprops) throws IllegalArgumentException
sprops
- line part after the #!, non-nullIllegalArgumentException
- on dup key in sprops and other errorspublic HostTxtEntry(String name, String dest, OrderedProperties props)
props
- may be nullpublic String getName()
public String getDest()
public OrderedProperties getProps()
public void write(BufferedWriter out) throws IOException
IOException
public void write(Writer out) throws IOException
IOException
public void writeRemoveLine(BufferedWriter out) throws IOException
IOException
public void writeRemove(Writer out) throws IOException
IOException
public void writeProps(Writer out) throws IOException
IOException
public boolean hasValidSig()
public boolean hasValidInnerSig()
public boolean hasValidRemoveSig()
public boolean equals(Object o)
public void sign(SigningPrivateKey spk)
public void signInner(SigningPrivateKey spk)
public void signRemove(SigningPrivateKey spk)