public class TimeStampOperator extends Object
| Constructor and Description |
|---|
TimeStampOperator() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
createRequest(PrivateKey privateKey,
Certificate[] certificates,
byte[] content,
byte[] hash)
Creates a time stamp request, signed with the users's certificate.
|
byte[] |
createRequest(String keystoreLocation,
String pin,
String alias,
byte[] content,
byte[] hash)
Creates a time stamp request using a certificate of type PKCS12.
|
Timestamp |
getTimestamp() |
byte[] |
invoke(byte[] request)
Sends the time stamp request
createRequest(PrivateKey, Certificate[], byte[], byte[]) to a time stamp server |
void |
setTimestamp(Timestamp timestamp) |
void |
validate(byte[] content,
byte[] timeStamp,
byte[] hash)
Validate a time stamp
|
public byte[] createRequest(PrivateKey privateKey, Certificate[] certificates, byte[] content, byte[] hash) throws CertificateCoreException
privateKey - private key to sign withcertificates - certificate chaincontent - set null if signing only hashhash - set null if signing contentCertificateCoreException - exceptionpublic byte[] createRequest(String keystoreLocation, String pin, String alias, byte[] content, byte[] hash) throws CertificateCoreException
keystoreLocation - key store location.pin - personal identification number.alias - alias.content - content of the request.hash - a hash.CertificateCoreException - exception.public byte[] invoke(byte[] request)
throws CertificateCoreException
createRequest(PrivateKey, Certificate[], byte[], byte[]) to a time stamp serverrequest - request to be sentCertificateCoreExceptionpublic void validate(byte[] content,
byte[] timeStamp,
byte[] hash)
throws CertificateCoreException
content - if it is assigned, the parameter hash must to be nulltimeStamp - timestamp to be validatedhash - if it is assigned, the parameter content must to be nullCertificateCoreException - validate exceptionpublic void setTimestamp(Timestamp timestamp)
public Timestamp getTimestamp()
Copyright © 2021 SERPRO - Serviço Federal de Processamento de Dados. All rights reserved.