Public Member Functions | Static Public Attributes

de.softpro.doc.SignRSA Interface Reference

Interface for creating an RSA signature. More...

List of all members.

Public Member Functions

byte[] sign (Source aSource, int aVersion, int aHashAlgorithm)
 Compute an RSA signature.
int getSignatureSize ()
 Get the size of the signature that will be computed by sign().
byte[] getSigningCertificate ()
 Get the signing certificate.
int getCertificateCount ()
 Get the number of available intermediate certificates.
byte[] getCertificate (int aIndex)
 Get an intermediate certificate.
String getErrorMessage ()
 Get an error message for the last operation.

Static Public Attributes

static final int v_1_5 = 0
 RSA version (padding): RSA 1.5 (PKCS1-v1_5, siganture scheme PKCS #1).
static final int v_2_0_salt0 = 1
 RSA version (padding): RSA 2.0 (signature scheme RSASSA-PSS) with salt length 0.
static final int v_2_0_salt32 = 2
 RSA version (padding): RSA 2.0 (signature scheme RSASSA-PSS) with salt length 32.
static final int v_2_0 = v_2_0_salt0
 Compatibility.
static final int ha_sha1 = 1
 Hash algorithm: SHA-1.
static final int ha_sha256 = 2
 Hash algorithm: SHA-256.
static final int ha_sha384 = 3
 Hash algorithm: SHA-384.
static final int ha_sha512 = 4
 Hash algorithm: SHA-512.
static final int ha_ripemd160 = 5
 Hash algorithm: RIPEMD-160.

Detailed Description

Interface for creating an RSA signature.

Selection of the certificate is up to the implementation.


Member Function Documentation

byte [] de.softpro.doc.SignRSA.getCertificate ( int  aIndex )

Get an intermediate certificate.

Parameters:
[in]aIndexThe zero-based index of the intermediate certificate, see getCertificateCount().
Returns:
The requested intermediate certificate (DER-encoded X.509) or null on error.
int de.softpro.doc.SignRSA.getCertificateCount (  )

Get the number of available intermediate certificates.

Returns:
The number of available intermediate certificates.
String de.softpro.doc.SignRSA.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).

Returns:
An error message (possibly empty if the last operation succeeded).
int de.softpro.doc.SignRSA.getSignatureSize (  )

Get the size of the signature that will be computed by sign().

Returns:
The size in octets of the signature that will be computed by sign() (ie, the size of the private key in octets) or a negative value on error.
byte [] de.softpro.doc.SignRSA.getSigningCertificate (  )

Get the signing certificate.

Returns:
The signing certificate (DER-encoded X.509) or null on error.
byte [] de.softpro.doc.SignRSA.sign ( Source  aSource,
int  aVersion,
int  aHashAlgorithm 
)

Compute an RSA signature.

Parameters:
[in]aSourceAn object providing data to be hashed and signed.
[in]aVersionRSA version (v_1_5 or v_2_0).
[in]aHashAlgorithmHash algorithm (ha_sha1, ha_sha256, ha_sha384, ha_sha512, or ha_ripemd160).
Returns:
The RSA signature. This shall be just the result of the RSA operation, not wrapped in an OCTET STRING.

Member Data Documentation

final int de.softpro.doc.SignRSA.ha_ripemd160 = 5 [static]

Hash algorithm: RIPEMD-160.

final int de.softpro.doc.SignRSA.ha_sha1 = 1 [static]

Hash algorithm: SHA-1.

final int de.softpro.doc.SignRSA.ha_sha256 = 2 [static]

Hash algorithm: SHA-256.

final int de.softpro.doc.SignRSA.ha_sha384 = 3 [static]

Hash algorithm: SHA-384.

final int de.softpro.doc.SignRSA.ha_sha512 = 4 [static]

Hash algorithm: SHA-512.

final int de.softpro.doc.SignRSA.v_1_5 = 0 [static]

RSA version (padding): RSA 1.5 (PKCS1-v1_5, siganture scheme PKCS #1).

Compatibility.

final int de.softpro.doc.SignRSA.v_2_0_salt0 = 1 [static]

RSA version (padding): RSA 2.0 (signature scheme RSASSA-PSS) with salt length 0.

This is used for signing TIFF documents with method m_digsig_pkcs1.

The hash algorithm passed in aHashAlgorithm of sign() shall also be used for mask generation, the salt length shall be 0.

final int de.softpro.doc.SignRSA.v_2_0_salt32 = 2 [static]

RSA version (padding): RSA 2.0 (signature scheme RSASSA-PSS) with salt length 32.

This is used for PKCS #7 signatures if integer parameter "RSASignatureScheme" is rss_pss.

The hash algorithm passed in aHashAlgorithm of sign() shall also be used for mask generation, the salt length shall be 32.


The documentation for this interface was generated from the following file: