class SAMUtils extends Object
Constructor and Description |
---|
SAMUtils() |
Modifier and Type | Method and Description |
---|---|
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
|
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 checkedpublic 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 resolvedDataFormatException
- on bad Base 64 or name not foundpublic static Properties parseParams(StringTokenizer tok) throws SAMException
tok
- A StringTokenizer pointing to the SAM parametersSAMException
- if the data was formatted incorrectly