|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tranche.commons.Debuggable
org.tranche.users.User
org.tranche.users.UserZipFile
public class UserZipFile
A helper class for packaging a user's certificate and private key and anything else in a standard ZIP file.
| Field Summary | |
|---|---|
static java.lang.String |
PRIVATE_KEY_NAME
Name of the private key file. |
static java.lang.String |
PUBLIC_CERTIFICATE_NAME
Name of the public certificate file. |
static int |
VERSION_LATEST
|
static int |
VERSION_ONE
|
| Fields inherited from class org.tranche.users.User |
|---|
ALL_PRIVILEGES, CAN_DELETE_DATA, CAN_DELETE_META_DATA, CAN_GET_CONFIGURATION, CAN_SET_CONFIGURATION, CAN_SET_DATA, CAN_SET_META_DATA, NO_PRIVILEGES |
| Constructor Summary | |
|---|---|
UserZipFile(java.io.File file)
|
|
UserZipFile(User user,
java.security.PrivateKey key)
|
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
Compares two UserZipFiles. |
java.security.cert.X509Certificate |
getCertificate()
Gets the certificate. |
java.lang.String |
getEmail()
|
java.io.File |
getFile()
Gets the file. |
int |
getFlags()
Gets the flags. |
java.lang.String |
getPassphrase()
Gets the passphrase used to decrypt the encrypted file. |
java.security.PrivateKey |
getPrivateKey()
Gets the private key. |
java.lang.String |
getUserNameFromCert()
Gets the user name of the user from the certificate. |
int |
hashCode()
|
boolean |
isExpired()
Returns true only if certificate is expired. |
boolean |
isNotYetValid()
Return true only if certificate not yet valid. |
boolean |
isValid()
Returns true if certificate is valid (not expired or and is valid.) |
void |
saveTo(java.io.File file)
Saves the user zip file to the given file. |
void |
setCertificate(java.security.cert.X509Certificate certificate)
Sets the certificate. |
void |
setEmail(java.lang.String email)
|
void |
setPassphrase(java.lang.String passphrase)
Sets the passphrase used to decrypt the encrypted file. |
void |
setPrivateKey(java.security.PrivateKey privateKey)
Sets the private key. |
| Methods inherited from class org.tranche.users.User |
|---|
canDeleteData, canDeleteMetaData, canGetConfiguration, canSetConfiguration, canSetData, canSetMetaData, compareTo, equals, isVersionOne, setFlags |
| Methods inherited from class org.tranche.commons.Debuggable |
|---|
debugErr, debugErr, debugOut, isDebug, setDebug |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int VERSION_ONE
public static final int VERSION_LATEST
public static final java.lang.String PUBLIC_CERTIFICATE_NAME
Name of the public certificate file.
public static final java.lang.String PRIVATE_KEY_NAME
Name of the private key file.
| Constructor Detail |
|---|
public UserZipFile(User user,
java.security.PrivateKey key)
user - key - public UserZipFile(java.io.File file)
file - | Method Detail |
|---|
public void saveTo(java.io.File file)
Saves the user zip file to the given file.
file - public java.io.File getFile()
Gets the file.
public java.lang.String getPassphrase()
Gets the passphrase used to decrypt the encrypted file.
public void setPassphrase(java.lang.String passphrase)
Sets the passphrase used to decrypt the encrypted file.
passphrase - public java.lang.String getEmail()
public void setEmail(java.lang.String email)
email - public java.security.PrivateKey getPrivateKey()
Gets the private key.
public void setPrivateKey(java.security.PrivateKey privateKey)
Sets the private key.
privateKey - public int getFlags()
Gets the flags.
getFlags in class Userpublic java.security.cert.X509Certificate getCertificate()
Gets the certificate.
getCertificate in class Userpublic void setCertificate(java.security.cert.X509Certificate certificate)
Sets the certificate.
setCertificate in class Usercertificate - public boolean isNotYetValid()
Return true only if certificate not yet valid.
public boolean isExpired()
Returns true only if certificate is expired.
public boolean isValid()
Returns true if certificate is valid (not expired or and is valid.)
public java.lang.String getUserNameFromCert()
Gets the user name of the user from the certificate.
public boolean equals(java.lang.Object o)
Compares two UserZipFiles.
equals in class java.lang.Objecto -
public int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||