|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectes.caib.signatura.impl.WebSignature
public class WebSignature
Implementation of the interface Signature for a web signature.
Signer,
Signature,
Serialized Form| Field Summary | |
|---|---|
protected byte[] |
signatureBytes
|
| Constructor Summary | |
|---|---|
WebSignature(java.lang.String firma)
Creates a signature object from a web signature. |
|
| Method Summary | |
|---|---|
java.security.cert.X509Certificate |
getCert()
Returns the X509 certificate used to sign. |
java.lang.String |
getCertCaName()
Gets the name of the certification authority of the certificate used to sign. |
java.security.cert.X509Certificate[] |
getCertificateChain()
Returns the certificate chain. |
java.lang.String |
getCertSubjectAlternativeNames()
Gets the concatenation of the subject's alternate name of the certificate used to sign as follows: name0 = value, name1 = value, ... |
java.lang.String |
getCertSubjectCommonName()
Gets the subject's Common Name of the certificate used to sign. |
java.lang.String |
getContentType()
Returns the content type of the signature. |
java.util.Date |
getDate()
Gets the date of the signature timestamp. |
protected java.lang.String |
getInternalClassName()
Gets the implementing class name. |
ParsedCertificate |
getParsedCertificate()
Gets a ParsedCertificate object with the subject's credentials. |
byte[] |
getPkcs7()
Returns the signature in PKCS#7 format. |
void |
setContentType(java.lang.String contentType)
|
void |
setPkcs7(byte[] pkcs7)
|
boolean |
verify()
Determinate the certificate validity of the signature. |
boolean |
verify(java.io.InputStream contentStream)
Verifies the digital signature of a document. |
boolean |
verifyAPosterioriTimestamp(java.io.InputStream contentStream)
Verifies the digital signature of a document. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected byte[] signatureBytes
| Constructor Detail |
|---|
public WebSignature(java.lang.String firma)
throws SignatureDataException
firma - Web signature.
java.io.IOException
SignatureDataException| Method Detail |
|---|
public void setContentType(java.lang.String contentType)
public void setPkcs7(byte[] pkcs7)
protected java.lang.String getInternalClassName()
public java.lang.String getCertCaName()
getCertCaName in interface Signaturepublic java.lang.String getCertSubjectCommonName()
getCertSubjectCommonName in interface Signaturepublic java.lang.String getCertSubjectAlternativeNames()
getCertSubjectAlternativeNames in interface Signaturepublic byte[] getPkcs7()
getPkcs7 in interface Signature
public java.util.Date getDate()
throws SignatureTimestampException
getDate in interface Signaturenull if the signature doesn't include timestamp.
SignatureTimestampException
public boolean verify()
throws SignatureVerifyException
verify in interface Signaturetrue if the certificate is valid; false otherwise.
SignatureVerifyExceptionSigner.verify(java.io.InputStream, es.caib.signatura.api.Signature)public java.lang.String getContentType()
getContentType in interface Signaturepublic java.security.cert.X509Certificate getCert()
getCert in interface Signature
public java.security.cert.X509Certificate[] getCertificateChain()
throws java.lang.Exception
getCertificateChain in interface Signaturejava.lang.Exceptionpublic ParsedCertificate getParsedCertificate()
getParsedCertificate in interface Signature
public boolean verify(java.io.InputStream contentStream)
throws SignatureProviderException,
java.io.IOException,
SignatureVerifyException
verify in interface SignaturecontentStream - byte stream of the document.
true if the verification process is correct; false otherwise.
SignatureProviderException - If the API provider cannot be accessed.
java.io.IOException - If the document or the timestamp server is not available.
SignatureVerifyException - If failed the verification process.
public boolean verifyAPosterioriTimestamp(java.io.InputStream contentStream)
throws SignatureProviderException,
java.io.IOException,
SignatureVerifyException
verifyAPosterioriTimestamp in interface SignaturecontentStream - byte stream of the document.
true if the verification process is correct; false otherwise.
SignatureProviderException - If the API provider cannot be accessed.
java.io.IOException - If the document or the timestamp server is not available.
SignatureVerifyException - If failed the verification process.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||