public interface EDOCPreparedSignature extends EDOCSignature
Use the getDocumentDigest() method to obtain the digest value for signature calculation.
Use the setSignatureValue(byte[]) method to provide the calculated signature value.
Use the setTimeStamp(TimeStamp) method to set a time stamp.
In order to add another signature or save the EDOC document,
the current EDOCPreparedSignature must be completed using the complete() method.
EDOC.prepareSignature(SignatureType, java.security.cert.X509Certificate)| Modifier and Type | Method and Description |
|---|---|
void |
complete()
Completes the current signature.
|
byte[] |
getDocumentDigest()
Returns the EDOC document digest value for signature calculation.
|
boolean |
isCompleted()
Returns true if this EDOCPreparedSignature instance is completed.
|
void |
setSignatureValue(byte[] signatureValue)
Sets the signature value bytes.
|
void |
setTimeStamp(TimeStamp timeStamp)
Sets the time stamp for the current signature.
|
getCertificate, getID, getSignatureTimeStamp, getSignatureType, getSignatureValue, getSignatureValueImprintDigest, getSignedDigest, getSigningTime, isDigitalSeal, validatebyte[] getDocumentDigest()
throws EDOCException
NOTE: The digest value is calculated using the 'SHA1' digesting algorithm. Resulting digest value is prepended with a 'SHA1' algorithm identifier to form a DigestInfo object, as defined by PKCS#7 Digest-encryption process (RFC 2315). The returned value is DER encoded DigestInfo value to be signed with the corresponding private key. Therefore, the signature must be calculated using a raw RSA (NONEwithRSA) signature algorithm.
EDOCException - if document digest value cannot be calculated.setSignatureValue(byte[])void setSignatureValue(byte[] signatureValue)
throws EDOCException
The signature value must be calculated for the EDOC document digest value using the raw RSA (NONEwithRSA) signature algorithm.
signatureValue - the signature value bytes.EDOCException - if signature value cannot be set.getDocumentDigest()void setTimeStamp(TimeStamp timeStamp) throws EDOCException
The input for the time stamp hash computation is the ds:SignatureValue XML element, as defined in ETSI TS 101 903 v1.3.2.
The signature value message imprint value can be obtained using the EDOCSignature.getSignatureValueImprintDigest() method.
timeStamp - the time stamp.EDOCException - if time stamp cannot be set.TimeStampGenerator.requestTimeStamp(byte[], java.security.KeyStore.Builder, String, String)void complete()
throws EDOCException
If required by the current signature level, the revocation data is also added during the completion process.
EDOCException - if signature cannot be completed.boolean isCompleted()