|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.sam.SAMUtils
class SAMUtils
Miscellaneous utility methods used by SAM protocol handlers.
Constructor Summary | |
---|---|
SAMUtils()
|
Method Summary | |
---|---|
static boolean |
checkDestination(String dest)
Check whether a base64-encoded dest is valid |
static boolean |
checkPrivateDestination(String dest)
Check whether a base64-encoded {dest,privkey,signingprivkey} is valid |
static void |
genRandomKey(OutputStream priv,
OutputStream pub)
Generate a random destination key using DSA_SHA1 signature type. |
static void |
genRandomKey(OutputStream priv,
OutputStream pub,
SigType sigType)
Generate a random destination key. |
static Destination |
getDest(String s)
Resolve the destination from a key or a hostname |
static Properties |
parseParams(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 |
---|
SAMUtils()
Method Detail |
---|
public static void genRandomKey(OutputStream priv, OutputStream pub)
priv
- Stream used to write the destination and private keyspub
- Stream used to write the destination (may be null)public static void genRandomKey(OutputStream priv, OutputStream pub, SigType sigType)
priv
- Stream used to write the destination and private keyspub
- Stream used to write the destination (may be null)sigType
- what signature typepublic static boolean checkDestination(String dest)
dest
- The base64-encoded destination to be checked
public static boolean checkPrivateDestination(String dest)
dest
- The base64-encoded destination and keys to be checked (same format as PrivateKeyFile)
public static Destination getDest(String s) throws DataFormatException
s
- Hostname or key to be resolved
DataFormatException
- on bad Base 64 or name not foundpublic static Properties parseParams(StringTokenizer tok) throws SAMException
tok
- A StringTokenizer pointing to the SAM parameters
SAMException
- if the data was formatted incorrectly
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |