com.lowagie.text.pdf

Class PdfSigGenericPKCS

public abstract class PdfSigGenericPKCS extends PdfSignature

A signature dictionary representation for the standard filters.
Nested Class Summary
static classPdfSigGenericPKCS.PPKLite
Creates a standard filter of the type self signed.
static classPdfSigGenericPKCS.PPKMS
Creates a standard filter of the type Windows Certificate.
static classPdfSigGenericPKCS.VeriSign
Creates a standard filter of the type VeriSign.
Field Summary
StringdigestEncryptionAlgorithm
byte[]externalDigest
byte[]externalRSAdata
protected StringhashAlgorithm
The hash algorith, for example "SHA1"
protected Stringname
The subject name in the signing certificate (the element "CN")
protected PdfPKCS7pkcs
The class instance that calculates the PKCS#1 and PKCS#7
protected Stringprovider
The crypto provider
Constructor Summary
PdfSigGenericPKCS(PdfName filter, PdfName subFilter)
Creates a generic standard filter.
Method Summary
StringgetName()
Gets the subject name in the signing certificate (the element "CN")
PdfPKCS7getSigner()
Gets the class instance that does the actual signing.
byte[]getSignerContents()
Gets the signature content.
voidsetExternalDigest(byte[] digest, byte[] RSAdata, String digestEncryptionAlgorithm)
Sets the digest/signature to an external calculated value.
voidsetSignInfo(PrivateKey privKey, Certificate[] certChain, CRL[] crlList)
Sets the crypto information to sign.

Field Detail

digestEncryptionAlgorithm

private String digestEncryptionAlgorithm

externalDigest

private byte[] externalDigest

externalRSAdata

private byte[] externalRSAdata

hashAlgorithm

protected String hashAlgorithm
The hash algorith, for example "SHA1"

name

protected String name
The subject name in the signing certificate (the element "CN")

pkcs

protected PdfPKCS7 pkcs
The class instance that calculates the PKCS#1 and PKCS#7

provider

protected String provider
The crypto provider

Constructor Detail

PdfSigGenericPKCS

public PdfSigGenericPKCS(PdfName filter, PdfName subFilter)
Creates a generic standard filter.

Parameters: filter the filter name subFilter the sub-filter name

Method Detail

getName

public String getName()
Gets the subject name in the signing certificate (the element "CN")

Returns: the subject name in the signing certificate (the element "CN")

getSigner

public PdfPKCS7 getSigner()
Gets the class instance that does the actual signing.

Returns: the class instance that does the actual signing

getSignerContents

public byte[] getSignerContents()
Gets the signature content. This can be a PKCS#1 or a PKCS#7. It corresponds to the /Contents key.

Returns: the signature content

setExternalDigest

public void setExternalDigest(byte[] digest, byte[] RSAdata, String digestEncryptionAlgorithm)
Sets the digest/signature to an external calculated value.

Parameters: digest the digest. This is the actual signature RSAdata the extra data that goes into the data tag in PKCS#7 digestEncryptionAlgorithm the encryption algorithm. It may must be null if the digest is also null. If the digest is not null then it may be "RSA" or "DSA"

setSignInfo

public void setSignInfo(PrivateKey privKey, Certificate[] certChain, CRL[] crlList)
Sets the crypto information to sign.

Parameters: privKey the private key certChain the certificate chain crlList the certificate revocation list. It can be null