summaryrefslogtreecommitdiff
path: root/pdf-over-signer/src/main
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-08-04 13:53:14 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-08-04 13:53:14 +0200
commit671d24d8e638b073b3aa5da00526978af2ebd06b (patch)
tree252998ce7e44d6db1c862c4ed9b7083d6aea5213 /pdf-over-signer/src/main
parent03b80912dc888296647412b0276e7610315fef13 (diff)
downloadpdf-over-671d24d8e638b073b3aa5da00526978af2ebd06b.tar.gz
pdf-over-671d24d8e638b073b3aa5da00526978af2ebd06b.tar.bz2
pdf-over-671d24d8e638b073b3aa5da00526978af2ebd06b.zip
pass Profile instead of String around
(in a bunch of different places)
Diffstat (limited to 'pdf-over-signer/src/main')
-rw-r--r--pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java
index 5898d2d1..c6613657 100644
--- a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java
+++ b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java
@@ -80,7 +80,7 @@ public class PdfAs4SignatureParameter {
private HashMap<String, String> genericProperties = new HashMap<String, String>();
- public String signatureProfileName = Profile.getDefaultProfile();
+ public Profile signatureProfile = Profile.getDefaultProfile();
public Image getPlaceholder() {
String sigProfile = getPdfAsSignatureProfileId();
@@ -104,7 +104,7 @@ public class PdfAs4SignatureParameter {
Image placeholder = pdfas.generateVisibleSignaturePreview(param, cert, 72 * 4);
// WORKAROUND for #110, manually paint a black border
- if (!this.signatureProfileName.equals(Profile.BASE_LOGO.name()))
+ if (!this.signatureProfile.equals(Profile.BASE_LOGO))
{
Graphics2D ctx = (Graphics2D)placeholder.getGraphics();
ctx.setColor(Color.BLACK);
@@ -165,18 +165,17 @@ public class PdfAs4SignatureParameter {
return Profile.INVISIBLE.name();
}
- Profile profile = Profile.getProfile(this.signatureProfileName);
- switch (profile) {
+ switch (this.signatureProfile) {
case BASE_LOGO:
case INVISIBLE:
- return this.signatureProfileName;
+ return this.signatureProfile.name();
case AMTSSIGNATURBLOCK:
- profileId = this.signatureProfileName;
+ profileId = this.signatureProfile.name();
profileId += getLangProfilePart(this.signatureLanguage);
profileId += "_RECOMMENDED";
return profileId;
default:
- profileId = this.signatureProfileName;
+ profileId = this.signatureProfile.name();
profileId += getLangProfilePart(this.signatureLanguage);
break;
}