public class SU3File extends Object
Modifier and Type | Field and Description |
---|---|
static int |
CONTENT_PLUGIN |
static int |
CONTENT_RESEED |
static int |
CONTENT_ROUTER |
static int |
CONTENT_UNKNOWN |
Constructor and Description |
---|
SU3File(File file) |
SU3File(I2PAppContext context,
File file) |
SU3File(String file) |
Modifier and Type | Method and Description |
---|---|
int |
getContentType() |
String |
getSignerString() |
SigType |
getSigType() |
String |
getVersionString() |
static void |
main(String[] args)
Parses command line arguments when this class is used from the command
line.
|
boolean |
verify()
One-pass verify.
|
boolean |
verifyAndMigrate(File migrateTo)
One-pass verify and extract the content.
|
void |
verifyHeader()
Throws IOE if verify vails.
|
void |
write(File content,
int contentType,
String version,
String signer,
PrivateKey privkey,
SigType sigType)
One-pass wrap and sign the content.
|
public static final int CONTENT_UNKNOWN
public static final int CONTENT_ROUTER
public static final int CONTENT_PLUGIN
public static final int CONTENT_RESEED
public SU3File(String file)
public SU3File(File file)
public SU3File(I2PAppContext context, File file)
public String getVersionString() throws IOException
IOException
public String getSignerString() throws IOException
IOException
public SigType getSigType() throws IOException
IOException
public int getContentType() throws IOException
IOException
public void verifyHeader() throws IOException
IOException
public boolean verify() throws IOException
IOException
public boolean verifyAndMigrate(File migrateTo) throws IOException
migrateTo
- the output file, probably in zip format. Null for verify only.IOException
public void write(File content, int contentType, String version, String signer, PrivateKey privkey, SigType sigType) throws IOException
content
- the input file, probably in zip formatcontentType
- 0-255, 0 for zipversion
- 1-255 bytes when converted to UTF-8signer
- ID of the public key, 1-255 bytes when converted to UTF-8IOException
public static void main(String[] args)
args
- Command line parameters.