Class PdfSigGenericPKCS
- java.lang.Object
-
- com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfObject
-
- com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfDictionary
-
- com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfSignature
-
- com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfSigGenericPKCS
-
- Direct Known Subclasses:
PdfSigGenericPKCS.PPKLite
,PdfSigGenericPKCS.PPKMS
,PdfSigGenericPKCS.VeriSign
public abstract class PdfSigGenericPKCS extends PdfSignature
A signature dictionary representation for the standard filters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PdfSigGenericPKCS.PPKLite
Creates a standard filter of the type self signed.static class
PdfSigGenericPKCS.PPKMS
Creates a standard filter of the type Windows Certificate.static class
PdfSigGenericPKCS.VeriSign
Creates a standard filter of the type VeriSign.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
digestEncryptionAlgorithm
private byte[]
externalDigest
private byte[]
externalRSAdata
protected java.lang.String
hashAlgorithm
The hash algorith, for example "SHA1"protected java.lang.String
name
The subject name in the signing certificate (the element "CN")protected PdfPKCS7
pkcs
The class instance that calculates the PKCS#1 and PKCS#7protected java.lang.String
provider
The crypto provider
-
Constructor Summary
Constructors Constructor Description PdfSigGenericPKCS(PdfName filter, PdfName subFilter)
Creates a generic standard filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
Gets the subject name in the signing certificate (the element "CN")PdfPKCS7
getSigner()
Gets the class instance that does the actual signing.byte[]
getSignerContents()
Gets the signature content.void
setExternalDigest(byte[] digest, byte[] RSAdata, java.lang.String digestEncryptionAlgorithm)
Sets the digest/signature to an external calculated value.void
setSignInfo(java.security.PrivateKey privKey, java.security.cert.Certificate[] certChain, java.security.cert.CRL[] crlList)
Sets the crypto information to sign.-
Methods inherited from class com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfSignature
setByteRange, setCert, setContact, setContents, setDate, setLocation, setName, setReason
-
Methods inherited from class com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfDictionary
contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, isCatalog, isDictionaryType, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putDel, putEx, remove, size, toPdf
-
Methods inherited from class com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, toString, type
-
-
-
-
Field Detail
-
hashAlgorithm
protected java.lang.String hashAlgorithm
The hash algorith, for example "SHA1"
-
provider
protected java.lang.String provider
The crypto provider
-
pkcs
protected PdfPKCS7 pkcs
The class instance that calculates the PKCS#1 and PKCS#7
-
name
protected java.lang.String name
The subject name in the signing certificate (the element "CN")
-
externalDigest
private byte[] externalDigest
-
externalRSAdata
private byte[] externalRSAdata
-
digestEncryptionAlgorithm
private java.lang.String digestEncryptionAlgorithm
-
-
Method Detail
-
setSignInfo
public void setSignInfo(java.security.PrivateKey privKey, java.security.cert.Certificate[] certChain, java.security.cert.CRL[] crlList)
Sets the crypto information to sign.- Parameters:
privKey
- the private keycertChain
- the certificate chaincrlList
- the certificate revocation list. It can benull
-
setExternalDigest
public void setExternalDigest(byte[] digest, byte[] RSAdata, java.lang.String digestEncryptionAlgorithm)
Sets the digest/signature to an external calculated value.- Parameters:
digest
- the digest. This is the actual signatureRSAdata
- the extra data that goes into the data tag in PKCS#7digestEncryptionAlgorithm
- the encryption algorithm. It may must benull
if thedigest
is alsonull
. If thedigest
is notnull
then it may be "RSA" or "DSA"
-
getName
public java.lang.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
-
-