|
Generated by JDiff |
||||||||
| PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES | |||||||||
This file contains all the changes in documentation in the packagecom.itextpdf.signaturesas colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a tag will cause all subsequent paragraphs to be displayed differently.
Verifies if an OCSP response is genuine If it doesn't verify against the issuer certificate and response's certificates, it may verify using a trusted anchor or cert. @param ocspResp the OCSP response @param issuerCert the issuer certificate. This certificate is considered trusted and valid by this method. @throwsClass OCSPVerifier, void isValidResponse(BasicOCSPResp, X509Certificate, Date)GeneralSecurityExceptionGeneralSecurityException if OCSP response verification cannot be done or failed @throwsIOExceptionIOException is not expected here. Will be removed in further releases @deprecated Will be removed in iText 7.2. Use .isValidResponse(BasicOCSPResp, X509Certificate, Date) instead
Verifies if an OCSP response is genuine If it doesn't verify against the issuer certificate and response's certificates, it may verify using a trusted anchor or cert. @param ocspResp the OCSP response @param issuerCert the issuer certificate. This certificate is considered trusted and valid by this method. @param signDate signClass OCSPVerifier, boolean verify(BasicOCSPResp, X509Certificate, X509Certificate, Date)datedate @throws GeneralSecurityException if OCSP response verification cannot be done or failed
Verifies a certificate against a single OCSP response @param ocspResp the OCSP response @param signCert the certificate that needs to be checked @param issuerCert the certificate of CA (certificate that issued signCert). This certificate is considered trusted and valid by this method. @param signDate signClass OCSPVerifier, Listdatedate @return {@code true}, in case successful check, otherwise false. @throwsGeneralSecurityExceptionGeneralSecurityException if OCSP response verification cannot be done or failed @throws IOException if issuer certificate is corrupted or has an incorrect structure
Verifies if aavalid OCSP response is found for the certificate. If this method returns false, it doesn't mean the certificate isn't valid. It means we couldn't verify it against any OCSP response that was available. @paramsignCert thesignCert the certificate that needs to be checked @param issuerCert itsissuerissuer @return a list ofVerificationOKobjects. The list will be empty if the certificate couldn't be verified. @see com.itextpdf.signatures.RootStoreVerifier#verify(java.security.cert.X509Certificate, java.security.cert.X509Certificate, java.util.Date)
Gets OCSP response. If OCSPVerifier was set, the response will be checked. @param checkCert to certificate to check @param rootCert the parent certificate @param url to get theverificationverification @return OCSP response
When using authenticatedAttributes the authentication process is different. The document digest is generated and put inside the attribute. The signing is done over the DER encoded authenticatedAttributes. This method provides that encoding and the parameters must be exactly the same as in .getEncodedPKCS7(byte[]).Class PdfPKCS7, byte[] getAuthenticatedAttributeBytes(byte[], byte[], CollectionA simple example:
Calendar cal = Calendar.getInstance(); PdfPKCS7 pk7 = new PdfPKCS7(key, chain, null, "SHA1", null, false); MessageDigest messageDigest = MessageDigest.getInstance("SHA1"); byte[] buf = new byte[8192]; int n; InputStream inp = sap.getRangeStream(); while ((n = inp.read(buf)) > 0) { messageDigest.update(buf, 0, n); } byte[] hash = messageDigest.digest(); byte[] sh = pk7.getAuthenticatedAttributeBytes(hash, cal); pk7.update(sh, 0, sh.length); byte[] sg = pk7.getEncodedPKCS7(hash, cal);@param secondDigest the content digest @param sigtype specifies the PKCS7 standard flavor to which created PKCS7SignedData object will adhere: either basic CMS or CAdES @param ocsp collection of DER-encoded OCSP responses for the certificate in the signature certificates chain, or null if OCSP revocation data is not to be added. @param crlBytes collection of DER-encoded CRL for certificates from the signature certificates chain, or null if CRL revocation data is not to be added. @return the byte array representation of the authenticatedAttributes ready to be signed
When using authenticatedAttributes the authentication process is different. The document digest is generated and put inside the attribute. The signing is done over the DER encoded authenticatedAttributes. This method provides that encoding and the parameters must be exactly the same as in .getEncodedPKCS7(byte[]).Class PdfPKCS7, String getDigestAlgorithm()A simple example:
Calendar cal = Calendar.getInstance(); PdfPKCS7 pk7 = new PdfPKCS7(key, chain, null, "SHA1", null, false); MessageDigest messageDigest = MessageDigest.getInstance("SHA1"); byte[] buf = new byte[8192]; int n; InputStream inp = sap.getRangeStream(); while ((n = inp.read(buf)) > 0) { messageDigest.update(buf, 0, n); } byte[] hash = messageDigest.digest(); byte[] sh = pk7.getAuthenticatedAttributeBytes(hash, cal); pk7.update(sh, 0, sh.length); byte[] sg = pk7.getEncodedPKCS7(hash, cal);@param secondDigest the content digest @param ocsp collection of DER-encoded OCSP responses for the certificate in the signature certificates chain, or null if OCSP revocation data is not to be added. @param crlBytes collection of DER-encoded CRL for certificates from the signature certificates chain, or null if CRL revocation data is not to be added. @param sigtype specifies the PKCS7 standard flavor to which created PKCS7SignedData object will adhere: either basic CMS or CAdES @return the byte array representation of the authenticatedAttributes ready to be signed @deprecated This method overload is deprecated. Please use .getAuthenticatedAttributeBytes(byte[], PdfSigner.CryptoStandard, Collection, Collection)
Get the algorithm used to calculate the message digest, e.g. "SHA1withRSA".Class PdfPKCS7, String getDigestAlgorithmOid()See ISO-32000-1, section 12.8.3.3 PKCS#7 Signatures as used in ISO 32000 @return the algorithm used to calculate the message digest
Getter for the ID of the digest algorithm, e.g. "2.16.840.1.101.3.4.2.1". See ISO-32000-1, section 12.8.3.3 PKCS#7 Signatures as used in ISO 32000 @return the ID of the digest algorithmClass PdfPKCS7, String getDigestEncryptionAlgorithmOid()
Getter for the digest encryption algorithm. See ISO-32000-1, section 12.8.3.3 PKCS#7 Signatures as used in ISO 32000 @return the encryption algorithmClass PdfPKCS7, PdfName getFilterSubtype()
ReturnsGetter for the filter subtype. @return the filter subtype
Gets the /Cert entry value of this signature. See ISO 32000-1 12.8.1, Table 252 # Entries in a signature dictionary. @return the signature certClass PdfSignature, PdfString getContents()
Gets the /Contents entry value. See ISO 32000-1 12.8.1, Table 252 # Entries in a signature dictionary. @return the signature content
Constructs appearance (top-level) for a signature. @Class PdfSignatureAppearance, PdfSignatureAppearance setCertificate(Certificate)see PPKAppearances.pdf for further details @return a top-level signature appearance @throws IOException if font cannot be created @see Adobe Pdf Digital Signature Appearances
Sets the certificate used to provide the text in the appearance. This certificate doesn't take part in the actual signing process. @param signCertificate theClass PdfSignatureAppearance, PdfSignatureAppearance setContact(String)certificatecertificate @return this instance to support fluent interface
Sets the signing contact. @param contact A new signingClass PdfSignatureAppearance, PdfSignatureAppearance setFieldName(String)contactcontact @return this instance to support fluent interface
Set the field name of the appearance. @param fieldName name of theClass PdfSignatureAppearance, PdfSignatureAppearance setImage(ImageData)fieldfield @return this instance to support fluent interface
Sets the background image for the layer 2. @param image the background image for the layerClass PdfSignatureAppearance, PdfSignatureAppearance setImageScale(float)22 @return this instance to support fluent interface
Sets the scaling to be applied to the background image. If it's zero the image will fully fill the rectangle. If it's less than zero the image will fill the rectangle but will keep the proportions. If it's greater than zero that scaling will be applied. In any of the cases the image will always be centered. It's zero by default. @param imageScale the scaling to be applied to the backgroundClass PdfSignatureAppearance, PdfSignatureAppearance setLayer2Font(PdfFont)imageimage @return this instance to support fluent interface
Sets the n2 and n4 layer font. If the font size is zero, auto-fit will be used. @param layer2Font the n2 and n4Class PdfSignatureAppearance, PdfSignatureAppearance setLayer2FontColor(Color)fontfont @return this instance to support fluent interface
Sets the n2 and n4 layer font color. @param color fontClass PdfSignatureAppearance, PdfSignatureAppearance setLayer2FontSize(float)colorcolor @return this instance to support fluent interface
Sets the n2 and n4 layer font size. @param fontSize fontClass PdfSignatureAppearance, PdfSignatureAppearance setLayer2Text(String)sizesize @return this instance to support fluent interface
Sets the signature text identifying the signer. @param text the signature text identifying the signer. If null or not set a standard description will beClass PdfSignatureAppearance, PdfSignatureAppearance setLocation(String)usedused @return this instance to support fluent interface
Sets the signing location. @param location A new signingClass PdfSignatureAppearance, PdfSignatureAppearance setLocationCaption(String)locationlocation @return this instance to support fluent interface
Sets the caption for the signing location. @param locationCaption A new signing locationClass PdfSignatureAppearance, PdfSignatureAppearance setPageNumber(int)captioncaption @return this instance to support fluent interface
Sets the page number of the signature field which this signature appearance is associated with. Implicitly calls PdfSignatureAppearance.setPageRect which considers page number to process the rectangle correctly. @param pageNumber The page number of the signature field which this signature appearance is associated with. @return this instance to support fluent interfaceClass PdfSignatureAppearance, PdfSignatureAppearance setPageRect(Rectangle)
Sets the rectangle that represent the position and dimension of the signature field in the page. @param pageRect The rectangle that represents the position and dimension of the signature field in the page. @return this instance to support fluent interfaceClass PdfSignatureAppearance, PdfSignatureAppearance setReason(String)
Sets the signing reason. @param reason signing reason. @return this instance to support fluent interfaceClass PdfSignatureAppearance, PdfSignatureAppearance setReasonCaption(String)
Sets the caption for the signing reason. @param reasonCaption A new signing reasonClass PdfSignatureAppearance, PdfSignatureAppearance setRenderingMode(RenderingMode)captioncaption @return this instance to support fluent interface
Sets the rendering mode for this signature. @param renderingMode the renderingClass PdfSignatureAppearance, PdfSignatureAppearance setReuseAppearance(boolean)modemode @return this instance to support fluent interface
Indicates that the existing appearances needs to be reused as layer 0. @param reuseAppearance is an appearances reusing flag value to set @return this instance to support fluent interfaceClass PdfSignatureAppearance, PdfSignatureAppearance setSignDate(Calendar)
Sets the signature date. @param signDate A new signatureClass PdfSignatureAppearance, PdfSignatureAppearance setSignatureCreator(String)datedate @return this instance to support fluent interface
Sets the name of the application used to create the signature. @param signatureCreator A new name of the application signing aClass PdfSignatureAppearance, PdfSignatureAppearance setSignatureGraphic(ImageData)documentdocument @return this instance to support fluent interface
Sets the Image object to render when Render is set to RenderingMode.GRAPHIC or RenderingMode.GRAPHIC_AND_DESCRIPTION. @param signatureGraphic image rendered. If null the mode is defaulted to RenderingMode.DESCRIPTIONDESCRIPTION @return this instance to support fluent interface
Creates a FieldLock instance. @param action indicates the set of fields that should be locked @param fields an array of text strings containing field namesClass SignaturePermissions.FieldLock, PdfName getAction()
Getter for the field lock action. @return the action of field lock dictionaryClass SignaturePermissions.FieldLock, PdfArray getFields()
Getter for the fields involved in the lock action. @return the fields of field lock dictionary
Creates an object that can inform you about the type of signature in a signature dictionary as well as some of the permissions defined by the signature. @param sigDict the signature dictionary @param previous the signature permissions
Extracts a revision from the document. @param field the signature field name @return an InputStream covering the revision. Returns null if it's not a signature field @throws IOException signals that an I/O exception has occurred.
Constructor. Note the token size estimate is updated by each call, as the token size is not likely to change (as long as we call the same TSA using the same imprint length). @param urlClass TSAClientBouncyCastle, MessageDigest getMessageDigest()String-Time Stamp Authority URL (i.e. "http://tsatest1.digistamp.com/TSA") @param usernameString-user(account) name @param passwordString-password @param tokSzEstimateint-estimated size of received time stamp token (DER encoded) @param digestAlgorithm is a hash algorithm
Gets the MessageDigest to digest the data imprint @return the digest algorithmClass TSAClientBouncyCastle, byte[] getTSAResponse(byte[])namename @throws GeneralSecurityException if digestAlgorithm doesn't match any known hash algorithm
Get timestamp token - communications layer @param requestBytes is a byte representation of TSA request @return - byte[] - TSA response, raw bytes (RFC 3161 encoded) @throws IOException if I/O issue occursClass TSAClientBouncyCastle, byte[] getTimeStampToken(byte[])
Get RFC 3161 timeStampToken. Method may return null indicating that timestamp should be skipped. @param imprint data imprint to be time-stampedstamped @return encoded, TSA signed data of the timeStampToken @throwsIOExceptionIOException if I/O error occurs @throws TSPException if the TSA response is malformed
Creates aVerificationExceptionVerificationException @param cert is a failed certificate @param message is a reason of failure