@@ -175,6 +175,8 @@ public void setMessageDigest(byte[] digest) {
175
175
* Sets the certificate that is used to sign.
176
176
*
177
177
* @param certificate the certificate that is used to sign
178
+ *
179
+ * @throws IOException if input-output exception occurs.
178
180
*/
179
181
public void setSigningCertificate (X509Certificate certificate ) throws IOException {
180
182
this .signerCertificate = certificate ;
@@ -200,6 +202,11 @@ public X509Certificate getSigningCertificate() {
200
202
*
201
203
* @param certificate the certificate that is used to sign
202
204
* @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.
203
210
*/
204
211
public void setSigningCertificateAndAddToSignedAttributes (X509Certificate certificate , String digestAlgorithmOid )
205
212
throws CertificateEncodingException , NoSuchAlgorithmException , NoSuchProviderException , IOException {
@@ -298,16 +305,18 @@ public void setSignatureAlgorithm(AlgorithmIdentifier algorithm) {
298
305
}
299
306
300
307
/**
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.
304
313
*/
305
314
public int getCmsVersion () {
306
315
return 1 ;
307
316
}
308
317
309
318
/**
310
- * Optional
319
+ * Optional.
311
320
*
312
321
* <p>
313
322
* Attributes that should be part of the signed content
@@ -326,6 +335,8 @@ public int getCmsVersion() {
326
335
* A message-digest attribute, having as its value the message
327
336
* digest of the content. Section 11.2 defines the message-digest
328
337
* attribute.
338
+ *
339
+ * @return collection of the signed attributes.
329
340
*/
330
341
public Collection <Attribute > getSignedAttributes () {
331
342
return Collections .unmodifiableCollection (signedAttributes );
0 commit comments