public abstract class PdfSignatureParameters extends SignatureParameters
Modifier and Type | Method and Description |
---|---|
void |
addContentTimestampProperties(java.lang.String tsaUrl,
java.lang.String username,
java.lang.String password)
Add all details required to create a content timestamp and add it as signed attribute to the
signature.
|
void |
addSignaturePolicyIdentifier(SignaturePolicyIdentifier policyIdentifier)
Adds a signature policy identifier required for a PAdES-EPES signature creation.
|
void |
addSignatureTimestampProperties(java.lang.String tsaUrl,
java.lang.String username,
java.lang.String password)
Add all details required to create a signature timestamp and add it as unsigned attribute to
the signature.
|
void |
addSignatureTimestampProperties(java.lang.String tsaUrl,
java.lang.String username,
java.lang.String password,
java.lang.String imprintDigestAlgorithm)
Add all details required to create a signature timestamp and add it as unsigned attribute to
the signature.
|
java.security.cert.CRL[] |
getCrls()
Get CRLs as array, that will be included in signature as signed attribute
|
int |
getEstimatedLength()
Get byte length of parameters to reserve sufficient space in signature field
|
java.lang.String |
getOcspUrl()
Get OCSP URL, that will be used for the creation of the OCSP response included in the signature
|
java.lang.String |
getSignatureContactInfo()
Get contact info given in signature.
|
Constants.SubFilter |
getSignatureEncoding()
Get the signature encoding (subfilter)
|
java.lang.String |
getSignatureLocation()
Get location where signature has been applied.
|
java.lang.String |
getSignatureReason()
Get reason given in signature.
|
TimestampProperties[] |
getSignatureTimestampProperties()
Get timestamp properties to create the respective number of signature timestamps.
|
java.util.Vector<iaik.asn1.structures.Attribute> |
getSignedSignerInfoAttributes(iaik.cms.SignedDataStream signedData,
iaik.cms.SignerInfo signerInfo,
iaik.x509.X509Certificate[] signerCertificateChain)
Return all signed attributes as determined by the respective parameter class.
|
java.lang.String |
getTsaPw()
Get password for authorization at the timestamp server, used to create the signature timestamp.
|
java.lang.String |
getTsaUrl()
Get URL of timestamp server, used to create the signature timestamp.
|
java.lang.String |
getTsaUsername()
Get username for authorization at the timestamp server, used to create the signature timestamp.
|
java.lang.String |
getTspImprintDigestAlgorithm()
Get digest algorithm, used to hash the data and create the signature timestamp.
|
java.util.Vector<iaik.asn1.structures.Attribute> |
getUnsignedSignerInfoAttributes(iaik.cms.SignedDataStream signedData,
iaik.cms.SignerInfo signerInfo,
iaik.x509.X509Certificate[] signerCertificateChain)
Return all unsigned attributes as determined by the respective parameter class.
|
void |
setContentTimestampProperties(java.lang.String tsaUrl,
java.lang.String username,
java.lang.String password)
Set all details required to create a content timestamp and add it as signed attribute to the
signature.
|
void |
setCrls(java.security.cert.CRL[] crls)
Set CRLs to be included in signature as signed attribute
|
void |
setDigestAlgorithm(java.lang.String hashAlgorithm)
Set digest algorithm used for content digest in signature.
|
void |
setOcspResponses(iaik.x509.ocsp.OCSPResponse[] ocspResponses)
Set OCSP responses to be included in signature as signed attribute.
|
void |
setOcspUrl(java.lang.String ocspUrl)
Given OCSP responder URL will be used, to request an OCSP response for the signer certificate
during signing.
|
void |
setOcspUrl(java.lang.String ocspUrl,
java.security.PrivateKey requestorKey,
iaik.x509.X509Certificate[] requestorCerts)
Given OCSP responder URL will be used, to request an OCSP response for the signer certificate
during signing.
|
void |
setSignatureContactInfo(java.lang.String contactinfo)
Specify contact information for signature
|
void |
setSignatureLocation(java.lang.String location)
Specify location for signature
|
void |
setSignatureReason(java.lang.String reason)
Specify reason for signature
|
void |
setSignatureTimestampProperties(java.lang.String tsaUrl,
java.lang.String username,
java.lang.String password)
Set all details required to create a signature timestamp and add it as unsigned attribute to
the signature.
|
void |
setSignatureTimestampProperties(java.lang.String tsaUrl,
java.lang.String username,
java.lang.String password,
java.lang.String imprintDigestAlgorithm)
Set all details required to create a signature timestamp and add it as unsigned attribute to
the signature.
|
void |
setTsaDetails(java.lang.String tsaUrl,
java.lang.String username,
java.lang.String password)
Deprecated.
|
getDigestAlgorithm, getSignatureAlgorithm, isSigningCertificateAttributeIncluded, setSignatureAlgorithm
public void setSignatureReason(java.lang.String reason)
reason
- Reason for signing the pdfpublic void setSignatureLocation(java.lang.String location)
location
- Location of signature creationpublic void setSignatureContactInfo(java.lang.String contactinfo)
contactinfo
- contact information of signerpublic void setDigestAlgorithm(java.lang.String hashAlgorithm)
SignatureParameters
setDigestAlgorithm
in class SignatureParameters
hashAlgorithm
- digest algorithm for hashing the contentpublic void setCrls(java.security.cert.CRL[] crls)
crls
- CRLs to be included in signaturepublic void setOcspResponses(iaik.x509.ocsp.OCSPResponse[] ocspResponses)
ocspResponses
- OCSP responses to be included in signaturepublic void setOcspUrl(java.lang.String ocspUrl)
ocspUrl
- OCSP-URL for getting OCSP responsepublic void setOcspUrl(java.lang.String ocspUrl, java.security.PrivateKey requestorKey, iaik.x509.X509Certificate[] requestorCerts) throws PdfSignatureException
ocspUrl
- OCSP-URL for getting OCSP responserequestorKey
- key to be used for signing the OCSP requestrequestorCerts
- requestor's certificate chainPdfSignatureException
public void setTsaDetails(java.lang.String tsaUrl, java.lang.String username, java.lang.String password) throws PdfSignatureException
setSignatureTimestampProperties(String,String,String)
insteadtsaUrl
- URL of the timestamp authorityusername
- username for authorizationpassword
- password for authorizationPdfSignatureException
- if tsaUrl is emptypublic void setSignatureTimestampProperties(java.lang.String tsaUrl, java.lang.String username, java.lang.String password) throws PdfSignatureException
TimeStampTokenUtil.DEFAULTDIGESTALGORITHM
is used, to hash the data that shall be
timestamped.tsaUrl
- URL of the timestamp authorityusername
- username for authorizationpassword
- password for authorizationPdfSignatureException
- if tsaUrl is emptypublic void setSignatureTimestampProperties(java.lang.String tsaUrl, java.lang.String username, java.lang.String password, java.lang.String imprintDigestAlgorithm) throws PdfSignatureException
TimeStampTokenUtil.DEFAULTDIGESTALGORITHM
is used.tsaUrl
- URL of the timestamp authorityusername
- username for authorizationpassword
- password for authorizationimprintDigestAlgorithm
- digest algorithm to hash the data, that shall be timestampedPdfSignatureException
- if tsaUrl is emptypublic void setContentTimestampProperties(java.lang.String tsaUrl, java.lang.String username, java.lang.String password) throws PdfSignatureException
tsaUrl
- URL of the timestamp authorityusername
- username for authorizationpassword
- password for authorizationPdfSignatureException
- if tsaUrl is emptypublic void addSignaturePolicyIdentifier(SignaturePolicyIdentifier policyIdentifier)
policyIdentifier
- the signature policy identifierpublic void addSignatureTimestampProperties(java.lang.String tsaUrl, java.lang.String username, java.lang.String password) throws PdfSignatureException
TimeStampTokenUtil.DEFAULTDIGESTALGORITHM
is used, to hash the data that shall be
timestamped.tsaUrl
- URL of the timestamp authorityusername
- username for authorizationpassword
- password for authorizationPdfSignatureException
- if tsaUrl is emptypublic void addSignatureTimestampProperties(java.lang.String tsaUrl, java.lang.String username, java.lang.String password, java.lang.String imprintDigestAlgorithm) throws PdfSignatureException
TimeStampTokenUtil.DEFAULTDIGESTALGORITHM
is used.tsaUrl
- URL of the timestamp authorityusername
- username for authorizationpassword
- password for authorizationimprintDigestAlgorithm
- digest algorithm to hash the data, that shall be timestampedPdfSignatureException
- if tsaUrl is emptypublic void addContentTimestampProperties(java.lang.String tsaUrl, java.lang.String username, java.lang.String password) throws PdfSignatureException
tsaUrl
- URL of the timestamp authorityusername
- username for authorizationpassword
- password for authorizationPdfSignatureException
- if tsaUrl is emptypublic Constants.SubFilter getSignatureEncoding()
public java.lang.String getSignatureReason()
public java.lang.String getSignatureLocation()
public java.lang.String getSignatureContactInfo()
public int getEstimatedLength()
public java.security.cert.CRL[] getCrls()
public java.lang.String getOcspUrl()
public java.lang.String getTsaUrl()
public java.lang.String getTsaUsername()
public java.lang.String getTsaPw()
public java.lang.String getTspImprintDigestAlgorithm()
public TimestampProperties[] getSignatureTimestampProperties()
public java.util.Vector<iaik.asn1.structures.Attribute> getSignedSignerInfoAttributes(iaik.cms.SignedDataStream signedData, iaik.cms.SignerInfo signerInfo, iaik.x509.X509Certificate[] signerCertificateChain) throws CmsCadesException
SignatureParameters
getSignedSignerInfoAttributes
in class SignatureParameters
signedData
- SignedData object containing the respective signer infosignerInfo
- the corresponding SignerInfo objectsignerCertificateChain
- used certificate chain for the corresponding signer infoCmsCadesException
- if an attribute can't be createdpublic java.util.Vector<iaik.asn1.structures.Attribute> getUnsignedSignerInfoAttributes(iaik.cms.SignedDataStream signedData, iaik.cms.SignerInfo signerInfo, iaik.x509.X509Certificate[] signerCertificateChain) throws CmsCadesException
SignatureParameters
getUnsignedSignerInfoAttributes
in class SignatureParameters
signedData
- SignedData object containing the respective signer infosignerInfo
- the corresponding SignerInfo objectsignerCertificateChain
- used certificate chain for the corresponding signer infoCmsCadesException
- if an attribute can't be created