From 464e7b1df6a0ff5d1450e5ff0f67101640edbc5e Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Tue, 2 Aug 2022 15:05:00 +0200 Subject: YAGNI: SignResult interface --- .../java/at/asit/pdfover/signator/SignResult.java | 45 ++++++++++++++++------ 1 file changed, 34 insertions(+), 11 deletions(-) (limited to 'pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignResult.java') diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignResult.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignResult.java index 9f9b591c..91bce421 100644 --- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignResult.java +++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignResult.java @@ -15,28 +15,51 @@ */ package at.asit.pdfover.signator; +//Imports import java.security.cert.X509Certificate; /** - * Signature Result containing the signed document as document source + * The result of a signature operation */ -public interface SignResult { +public class SignResult { + + private SignaturePosition position; + private DocumentSource source; + private X509Certificate certificate; + + public SignaturePosition getSignaturePosition() { + return this.position; + } + + public DocumentSource getSignedDocument() { + return this.source; + } + + public X509Certificate getSignerCertificate() { + return this.certificate; + } /** - * Getter of the property signaturePosition - * @return Returns the signaturePosition. + * Set the signer certificate + * @param x509Certificate the signer certificate */ - public SignaturePosition getSignaturePosition(); + public void setSignerCertificate(X509Certificate x509Certificate) { + this.certificate = x509Certificate; + } /** - * Gets the signed Document - * @return Returns the documentSource. + * Set the signature position + * @param postion the signature position */ - public DocumentSource getSignedDocument(); + public void setSignaturePosition(SignaturePosition postion) { + this.position = postion; + } /** - * Gets the signer certificate - * @return The signer x509 certificate + * Set the signed document + * @param source DocumentSource containing the signed document */ - public X509Certificate getSignerCertificate(); + public void setSignedDocument(DocumentSource source) { + this.source = source; + } } -- cgit v1.2.3