Skip to content

Commit 0733750

Browse files
committed
Fix javadocs warnings
DEVSIX-7842
1 parent 22b636b commit 0733750

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

sign/src/main/java/com/itextpdf/signatures/cms/CMSContainer.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ public SignerInfo getSignerInfo() {
145145
*
146146
* @return the estimated size of the complete CMS container before signature is added, size for the signature is
147147
* added, size for other attributes like timestamps is not.
148+
*
149+
* @throws CertificateEncodingException if an encoding error occurs in {@link X509Certificate}.
150+
* @throws IOException if an I/O error occurs.
148151
*/
149152
public long getSizeEstimation() throws CertificateEncodingException, IOException {
150153
byte[] result = serialize(true);
@@ -163,8 +166,11 @@ public int getCmsVersion() {
163166
/**
164167
* The digest algorithm OID and parameters used by the signer.
165168
* This class only supports one signer for use in pdf signatures, so only one digest algorithm is supported.
166-
* </P>
169+
*
170+
* <p>
167171
* This field is set when adding the signerInfo.
172+
*
173+
* @return {@link AlgorithmIdentifier} digest algorithm.
168174
*/
169175
public AlgorithmIdentifier getDigestAlgorithm() {
170176
if (signerInfo == null) {

sign/src/main/java/com/itextpdf/signatures/cms/SignerInfo.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ public void setMessageDigest(byte[] digest) {
175175
* Sets the certificate that is used to sign.
176176
*
177177
* @param certificate the certificate that is used to sign
178+
*
179+
* @throws IOException if input-output exception occurs.
178180
*/
179181
public void setSigningCertificate(X509Certificate certificate) throws IOException {
180182
this.signerCertificate = certificate;
@@ -200,6 +202,11 @@ public X509Certificate getSigningCertificate() {
200202
*
201203
* @param certificate the certificate that is used to sign
202204
* @param digestAlgorithmOid the oid of the digest algorithm to be added to the signed attributes
205+
*
206+
* @throws CertificateEncodingException if an encoding error occurs.
207+
* @throws NoSuchAlgorithmException when the algorithm is unknown.
208+
* @throws NoSuchProviderException when provider is unknown.
209+
* @throws IOException if input-output exception occurs.
203210
*/
204211
public void setSigningCertificateAndAddToSignedAttributes(X509Certificate certificate, String digestAlgorithmOid)
205212
throws CertificateEncodingException, NoSuchAlgorithmException, NoSuchProviderException, IOException {
@@ -298,16 +305,18 @@ public void setSignatureAlgorithm(AlgorithmIdentifier algorithm) {
298305
}
299306

300307
/**
301-
* Value 0 when no signerIdentifier is available
302-
* Value 1 when signerIdentifier is of type issuerAndSerialNumber
303-
* Value 3 when signerIdentifier is of type subjectKeyIdentifier
308+
* Value 0 when no signerIdentifier is available.
309+
* Value 1 when signerIdentifier is of type issuerAndSerialNumber.
310+
* Value 3 when signerIdentifier is of type subjectKeyIdentifier.
311+
*
312+
* @return CMS version.
304313
*/
305314
public int getCmsVersion() {
306315
return 1;
307316
}
308317

309318
/**
310-
* Optional
319+
* Optional.
311320
*
312321
* <p>
313322
* Attributes that should be part of the signed content
@@ -326,6 +335,8 @@ public int getCmsVersion() {
326335
* A message-digest attribute, having as its value the message
327336
* digest of the content. Section 11.2 defines the message-digest
328337
* attribute.
338+
*
339+
* @return collection of the signed attributes.
329340
*/
330341
public Collection<Attribute> getSignedAttributes() {
331342
return Collections.unmodifiableCollection(signedAttributes);

0 commit comments

Comments
 (0)