|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.sam.SAMUtils
public class SAMUtils
Miscellaneous utility methods used by SAM protocol handlers.
Nested Class Summary | |
---|---|
static class |
SAMUtils.InvalidDestination
|
Constructor Summary | |
---|---|
SAMUtils()
|
Method Summary | |
---|---|
static boolean |
checkDestination(java.lang.String dest)
Check whether a base64-encoded dest is valid |
static void |
checkPrivateDestination(java.lang.String dest)
|
static void |
genRandomKey(java.io.OutputStream priv,
java.io.OutputStream pub)
Generate a random destination key |
static Destination |
getDest(java.lang.String s)
Resolve the destination from a key or a hostname |
static Destination |
lookupHost(java.lang.String name,
java.io.OutputStream pubKey)
Resolved the specified hostname. |
static void |
main(java.lang.String[] args)
|
static java.util.Properties |
parseParams(java.util.StringTokenizer tok)
Parse SAM parameters, and put them into a Propetries object |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SAMUtils()
Method Detail |
---|
public static void genRandomKey(java.io.OutputStream priv, java.io.OutputStream pub)
priv
- Stream used to write the private keypub
- Stream used to write the public key (may be null)public static boolean checkDestination(java.lang.String dest)
dest
- The base64-encoded destination to be checked
public static void checkPrivateDestination(java.lang.String dest) throws SAMUtils.InvalidDestination
SAMUtils.InvalidDestination
public static Destination lookupHost(java.lang.String name, java.io.OutputStream pubKey)
name
- Hostname to be resolvedpubKey
- A stream to write the Destination public key (may be null)
public static Destination getDest(java.lang.String s) throws DataFormatException
s
- Hostname or key to be resolved
DataFormatException
public static java.util.Properties parseParams(java.util.StringTokenizer tok) throws SAMException
tok
- A StringTokenizer pointing to the SAM parameters
SAMException
- if the data was formatted incorrectlypublic static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |