Skip to content

Commit

Permalink
v3.0.2
Browse files Browse the repository at this point in the history
Documentation updates and bugfixes
  • Loading branch information
SendSafely-GitHub committed Jan 11, 2019
1 parent 999443d commit a581155
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 13 deletions.
3 changes: 3 additions & 0 deletions SendSafelyAPI/src/com/sendsafely/Privatekey.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ public class Privatekey {
public String getArmoredKey() {
return privateKey;
}

public void setArmoredKey(String privateKey) {
this.privateKey = privateKey;
}

public String getPublicKeyId() {
return publicKeyId;
}

public void setPublicKeyId(String publicKeyId) {
this.publicKeyId = publicKeyId;
}
Expand Down
31 changes: 20 additions & 11 deletions SendSafelyAPI/src/com/sendsafely/SendSafely.java
Original file line number Diff line number Diff line change
Expand Up @@ -455,12 +455,12 @@ public java.io.File downloadFile(String packageId, String fileId, String keyCode
return handler.makeRequest(packageId, null, fileId, keyCode, progress, null);
}

/*
* @ description Gets a list of Recipient History information.
* @ param recipientEmail
* @ returnType List<RecipientHistory>
* @ return a List<RecipientHistory> object containing a list of all recipient history items.
* @ throws RecipientFailedException
/**
* @description Retrieves a list of packages where the passed in email address is a package recipient.
* @param recipientEmail The email address of the recipient.
* @returnType List<RecipientHistory>
* @return A List<RecipientHistory> containing information about each package retrieved, including confirmed downloads for the recipient.
* @throws RecipientFailedException
*/
public List<RecipientHistory> getRecipientHistory(String recipientEmail) throws RecipientFailedException{
GetRecipientHistoryHandler handler = ((GetRecipientHistoryHandler)HandlerFactory.getInstance(uploadManager, Endpoint.RECIPIENT_HISTORY));
Expand Down Expand Up @@ -568,8 +568,8 @@ public File encryptAndUploadFile(String packageId, String keyCode, FileManager f
}

/**
* @description Deletes a package given a package ID.
* @param packageId The unique package id of the package for the delete temporary package operation.
* @description Deletes a temporary package, which is a package that has not yet been finalized.
* @param packageId The unique package id of the package to be deleted.
* @throws DeletePackageException
*/
public void deleteTempPackage(String packageId) throws DeletePackageException
Expand Down Expand Up @@ -598,8 +598,9 @@ public File encryptAndUploadFile(String packageId, String keyCode, String server
}

/**
* @description Get all received packages
* @return List<String> a list of all received package IDs.
* @description Retrieves a list of all active packages received for the given API User.
* @return A List<PackageReference> containing package metadata for all received packages.
* @returnType List<PackageReference>
* @throws GetPackagesException
*/
public List<PackageReference> getReceivedPackages() throws GetPackagesException
Expand Down Expand Up @@ -892,7 +893,7 @@ public EnterpriseInfo getEnterpriseInfo() throws EnterpriseInfoFailedException
}

/**
* @description Generates a new RSA Key pair used to encrypt keycodes. The private key as well as an identifier associating the public Key is returned to the user. The public key is uploaded and stored on the SendSafely servers.
* @description Generates a new RSA Key pair used to encrypt keycodes. The private key as well as an identifier associating the public Key is returned to the user. The public key is uploaded and stored on the SendSafely servers.
* @param description The description used for generating the key pair.
* @returnType Privatekey
* @return Returns a Private Key containing the armored private key and a Public Key ID associating a public key to the private key.
Expand All @@ -912,6 +913,14 @@ public Privatekey generateKeyPair(String description) throws NoSuchAlgorithmExce
return privateKey;
}

/**
* @description Downloads and decrypts a keycode from the server for a given packageId and RSA Key pair.
* @param packageId The package id for the keycode.
* @param privateKey The private key associated with the RSA Key pair used to encrypt the package keycode.
* @return Returns the decrypted keycode.
* @returnType String
* @throws GetKeycodeFailedException
*/
public String getKeycode(String packageId, Privatekey privateKey) throws GetKeycodeFailedException{
GetKeycode handler = new GetKeycode(uploadManager);
return handler.get(packageId, privateKey);
Expand Down
28 changes: 28 additions & 0 deletions SendSafelyAPI/src/com/sendsafely/dto/RecipientHistory.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,87 +21,115 @@ public class RecipientHistory {
private Recipient packageRecipientResponse;
private Set<String> filenames;
private boolean packageContainsMessage;

public String getPackageId() {
return packageId;
}

public void setPackageId(String packageId) {
this.packageId = packageId;
}

public String getPackageUserName() {
return packageUserName;
}

public void setPackageUserName(String packageUserName) {
this.packageUserName = packageUserName;
}

public String getPackageUserId() {
return packageUserId;
}

public void setPackageUserId(String packageUserId) {
this.packageUserId = packageUserId;
}

public int getPackageState() {
return packageState;
}

public void setPackageState(int packageState) {
this.packageState = packageState;
}

public String getPackageStateStr() {
return packageStateStr;
}

public void setPackageStateStr(String packageStateStr) {
this.packageStateStr = packageStateStr;
}

public String getPackageStateColor() {
return packageStateColor;
}

public void setPackageStateColor(String packageStateColor) {
this.packageStateColor = packageStateColor;
}

public int getPackageLife() {
return packageLife;
}

public void setPackageLife(int packageLife) {
this.packageLife = packageLife;
}

public String getPackageUpdateTimestampStr() {
return packageUpdateTimestampStr;
}

public void setPackageUpdateTimestampStr(String packageUpdateTimestampStr) {
this.packageUpdateTimestampStr = packageUpdateTimestampStr;
}

public Date getPackageUpdateTimestamp() {
return packageUpdateTimestamp;
}

public void setPackageUpdateTimestamp(Date packageUpdateTimestamp) {
this.packageUpdateTimestamp = packageUpdateTimestamp;
}

public String getPackageCode() {
return packageCode;
}

public void setPackageCode(String packageCode) {
this.packageCode = packageCode;
}

public String getPackageOS() {
return packageOS;
}

public void setPackageOS(String packageOS) {
this.packageOS = packageOS;
}

public Recipient getPackageRecipientResponse() {
return packageRecipientResponse;
}

public void setPackageRecipientResponse(Recipient packageRecipientResponse) {
this.packageRecipientResponse = packageRecipientResponse;
}

public Set<String> getFilenames() {
return filenames;
}

public void setFilenames(Set<String> filenames) {
this.filenames = filenames;
}

public boolean isPackageContainsMessage() {
return packageContainsMessage;
}

public void setPackageContainsMessage(boolean packageContainsMessage) {
this.packageContainsMessage = packageContainsMessage;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public GetOrganizationPackagesHandler(UploadManager uploadManager) {
public PackageSearchResults makeRequest(Date fromDate, Date toDate, String sender, PackageStatus status,
String recipient, String fileName) throws GetPackagesException {
//Convert Date to String to pass to server.
SimpleDateFormat outputDateFormat = new SimpleDateFormat("MM/dd/YYYY");
SimpleDateFormat outputDateFormat = new SimpleDateFormat("MM/dd/yyyy");
String fromDateStr = fromDate==null?"":outputDateFormat.format(fromDate);
String toDateStr = toDate==null?"":outputDateFormat.format(toDate);
request.setFromDate(fromDateStr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public class ParseLinksHandler
{
private final String REGEX = "(https:\\/\\/[a-zA-Z\\.]+\\/receive\\/\\?[A-Za-z0-9&=\\-]+packageCode=[A-Za-z0-9\\-_]+#keyCode=[A-Za-z0-9\\-_]+)";
private final String REGEX = "(https:\\/\\/[a-zA-Z\\.-]+\\/receive\\/\\?[A-Za-z0-9&=\\-]+packageCode=[A-Za-z0-9\\-_]+#keyCode=[A-Za-z0-9\\-_]+)";

public List<String> parse(String text) {
List<String> links = new ArrayList<String>();
Expand Down

0 comments on commit a581155

Please sign in to comment.