Interface for creating a PKCS #7 or CAdES signature. More...
Public Member Functions | |
byte[] | sign (Source aSource, boolean aDetached, int aHashAlgorithm, TimeStamper aTimeStamper) |
Sign data, producing a PKCS #7 or CAdES signature. | |
int | getSignatureSize (boolean aDetached, int aHashAlgorithm) |
Compute the size of the signature produced by sign(). | |
String | getSubjectCommonName () |
Get the common name (CN) of the certificate's subject. | |
String | getErrorMessage () |
Get an error message for the last operation. | |
Static Public Attributes | |
static final int | ha_none = 0 |
Hash algorithm: Invalid hash algorithm. | |
static final int | ha_sha1 = 1 |
Hash algorithm: SHA-1. | |
static final int | ha_sha256 = 2 |
Hash algorithm: SHA-256. | |
static final int | ha_md5 = 3 |
Hash algorithm: MD5. | |
static final int | ha_sha384 = 4 |
Hash algorithm: SHA-384. | |
static final int | ha_sha512 = 5 |
Hash algorithm: SHA-512. | |
static final int | ha_ripemd160 = 6 |
Hash algorithm: RIPEMD-160. | |
static final int | ha_sha224 = 7 |
Hash algorithm: SHA-224. |
Interface for creating a PKCS #7 or CAdES signature.
Selection of the certificate, including intermediate certifcatse, and implementing CAdES is up to the implementation.
This interface is quite hard to use, please use interface SignRSA instead.
String de.softpro.doc.SignPKCS7.getErrorMessage | ( | ) |
Get an error message for the last operation.
After any method of this object has been called, this function shall return an error message (possibly empty if the most recently called method didn't fail).
int de.softpro.doc.SignPKCS7.getSignatureSize | ( | boolean | aDetached, |
int | aHashAlgorithm | ||
) |
Compute the size of the signature produced by sign().
[in] | aDetached | true for a detached signature, false for an encapsulated signature. |
[in] | aHashAlgorithm | Hash algorithm to be used for signature: ha_md5, ha_sha1, ha_sha224, ha_sha256, ha_sha384, ha_sha512, or ha_ripemd160. This parameter also determines the size of encapsulated data (20 octets for ha_sha1) if aDetached is false. You might want to ignore this value for ECDSA signatures as it might come from the DigestMethod seed value, which is to be used for RSA only. |
String de.softpro.doc.SignPKCS7.getSubjectCommonName | ( | ) |
Get the common name (CN) of the certificate's subject.
byte [] de.softpro.doc.SignPKCS7.sign | ( | Source | aSource, |
boolean | aDetached, | ||
int | aHashAlgorithm, | ||
TimeStamper | aTimeStamper | ||
) |
Sign data, producing a PKCS #7 or CAdES signature.
[in] | aSource | An object providing data to be hashed and signed. If aDetached is false, all the data shall be encapsulated in the PKCS #7 message. |
[in] | aDetached | true for a detached signature, false for an encapsulated signature. |
[in] | aHashAlgorithm | Hash algorithm to be used for signature: ha_md5, ha_sha1, ha_sha224, ha_sha256, ha_sha384, ha_sha512, or ha_ripemd160. You might want to ignore this value for ECDSA signatures as it might come from the DigestMethod seed value, which is to be used for RSA only. |
[in] | aTimeStamper | Non-null to use a time-stamp server. |
final int de.softpro.doc.SignPKCS7.ha_md5 = 3 [static] |
Hash algorithm: MD5.
final int de.softpro.doc.SignPKCS7.ha_none = 0 [static] |
Hash algorithm: Invalid hash algorithm.
final int de.softpro.doc.SignPKCS7.ha_ripemd160 = 6 [static] |
Hash algorithm: RIPEMD-160.
final int de.softpro.doc.SignPKCS7.ha_sha1 = 1 [static] |
Hash algorithm: SHA-1.
final int de.softpro.doc.SignPKCS7.ha_sha224 = 7 [static] |
Hash algorithm: SHA-224.
final int de.softpro.doc.SignPKCS7.ha_sha256 = 2 [static] |
Hash algorithm: SHA-256.
final int de.softpro.doc.SignPKCS7.ha_sha384 = 4 [static] |
Hash algorithm: SHA-384.
final int de.softpro.doc.SignPKCS7.ha_sha512 = 5 [static] |
Hash algorithm: SHA-512.