public final class PdfPKCS7 extends Object
It's based in code found at org.spongycastle.
| Modifier and Type | Class and Description |
|---|---|
static class |
PdfPKCS7.X509Name
a class that holds an X509 name
|
| Modifier and Type | Method and Description |
|---|---|
Certificate[] |
getCertificates()
Get all the X.509 certificates associated with this PKCS#7 object in no particular order.
|
Collection<CRL> |
getCRLs()
Get the X.509 certificate revocation lists associated with this PKCS#7 object
|
String |
getDigestAlgorithm()
Get the algorithm used to calculate the message digest
|
byte[] |
getEncodedPKCS1()
Gets the bytes for the PKCS#1 object.
|
byte[] |
getEncodedPKCS7()
Gets the bytes for the PKCS7SignedData object.
|
String |
getHashAlgorithm()
Returns the algorithm.
|
String |
getLocation()
Getter for property location.
|
org.spongycastle.cert.ocsp.BasicOCSPResp |
getOcsp()
Gets the OCSP basic response if there is one.
|
byte[] |
getPkcs1()
Obtiene el PKCS#1 de la firma PKCS#7 del PDF.
|
String |
getReason()
Getter for property reason.
|
Certificate[] |
getSignCertificateChain()
Get the X.509 sign certificate chain associated with this PKCS#7 object.
|
Calendar |
getSignDate()
Getter for property signDate.
|
X509Certificate |
getSigningCertificate()
Get the X.509 certificate actually used to sign the digest.
|
int |
getSigningInfoVersion()
Get the version of the PKCS#7 "SignerInfo" object.
|
String |
getSignName()
Getter for property sigName.
|
static PdfPKCS7.X509Name |
getSubjectFields(X509Certificate cert)
Get the subject fields from an X509 Certificate
|
Calendar |
getTimeStampDate()
Gets the timestamp date
|
org.spongycastle.tsp.TimeStampToken |
getTimeStampToken()
Gets the timestamp token if there is one.
|
int |
getVersion()
Get the version of the PKCS#7 object.
|
boolean |
isRevocationValid()
Checks if OCSP revocation refers to the document signing certificate.
|
void |
setExternalDigest(byte[] digest,
byte[] RSAdata,
String digestEncryptionAlgorithm)
Sets the digest/signature to an external calculated value.
|
void |
setLocation(String location)
Setter for property location.
|
void |
setReason(String reason)
Setter for property reason.
|
void |
setSignDate(Calendar signDate)
Setter for property signDate.
|
void |
setSignName(String signName)
Setter for property sigName.
|
boolean |
verify()
Verify the digest.
|
public byte[] getPkcs1()
public org.spongycastle.tsp.TimeStampToken getTimeStampToken()
public Calendar getTimeStampDate()
public org.spongycastle.cert.ocsp.BasicOCSPResp getOcsp()
public Certificate[] getCertificates()
public Certificate[] getSignCertificateChain()
public Collection<CRL> getCRLs()
public X509Certificate getSigningCertificate()
public int getVersion()
public int getSigningInfoVersion()
public String getDigestAlgorithm()
null
if it couldn't identify the encryption algorithm.public String getHashAlgorithm()
public boolean isRevocationValid()
public static PdfPKCS7.X509Name getSubjectFields(X509Certificate cert)
cert - an X509Certificatepublic byte[] getEncodedPKCS1()
public void setExternalDigest(byte[] digest,
byte[] RSAdata,
String digestEncryptionAlgorithm)
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 be null if the digest
is also null. If the digest is not null
then it may be "RSA" or "DSA"public byte[] getEncodedPKCS7()
public String getReason()
public void setReason(String reason)
reason - New value of property reason.public String getLocation()
public void setLocation(String location)
location - New value of property location.public Calendar getSignDate()
public void setSignDate(Calendar signDate)
signDate - New value of property signDate.public String getSignName()
public void setSignName(String signName)
signName - New value of property sigName.public boolean verify()
throws SignatureException
true if the signature checks out, false otherwise.SignatureException - on errorCopyright © 2021. All rights reserved.