Class IdAaEtsEscTimeStamp
java.lang.Object
br.ufsc.labsec.signature.conformanceVerifier.cades.attributes.TimeStamp<org.bouncycastle.asn1.cms.Attribute>
br.ufsc.labsec.signature.conformanceVerifier.cades.attributes.unsigned.TimeStampToken
br.ufsc.labsec.signature.conformanceVerifier.cades.attributes.unsigned.IdAaEtsEscTimeStamp
- All Implemented Interfaces:
SignatureAttribute<org.bouncycastle.asn1.cms.Attribute>
,Comparable<TimeStamp<org.bouncycastle.asn1.cms.Attribute>>
public class IdAaEtsEscTimeStamp extends TimeStampToken
Repesenta o carimbo de tempo sobre as referências no formato CAdES.
Oid e esquema do atributo id-aa-ets-escTimeStamp retirado do documento ETSI TS 101 733 V1.8.1:
id-aa-ets-escTimeStamp OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) id-aa(2) 25} ESCTimeStampToken ::= TimeStampToken
-
Field Summary
Fields Modifier and Type Field Description static String
IDENTIFIER
Fields inherited from class br.ufsc.labsec.signature.conformanceVerifier.cades.attributes.unsigned.TimeStampToken
FAILURE_TO_VALIDATE_TIMESTAMP, INVALID_ASYMMETRIC_CIPHER_ERROR, INVALID_TIMESTAMP_ERROR, signatureVerifier
Fields inherited from class br.ufsc.labsec.signature.conformanceVerifier.cades.attributes.TimeStamp
contentInfo
-
Constructor Summary
Constructors Constructor Description IdAaEtsEscTimeStamp(AbstractVerifier verifier, Integer index)
Deve-se utilizar este construtor no momento de validação do atributo.IdAaEtsEscTimeStamp(org.bouncycastle.asn1.cms.Attribute genericEncoding)
Constrói um objetoIdAaEtsEscTimeStamp
IdAaEtsEscTimeStamp(org.bouncycastle.asn1.cms.ContentInfo contentInfo)
Constrói um objetoIdAaEtsEscTimeStamp
a partir de umContentInfo
. -
Method Summary
Modifier and Type Method Description protected byte[]
getAttributeHash(String identifier, boolean hashWithoutTag)
Calcula o hash do atributoString
getIdentifier()
Retorna o identificador do atributoprotected boolean
isAttributeHashValid(String identifier, boolean hashWithoutTag, byte[] expected)
protected TimeStampVerifier
makeTimeStampVerifier(org.bouncycastle.tsp.TimeStampToken timeStamp, boolean containsRefsTimestamp, boolean containsArchiveTimestamp)
Obtém umTimeStampVerifier
.Methods inherited from class br.ufsc.labsec.signature.conformanceVerifier.cades.attributes.unsigned.TimeStampToken
createSignerInformationVerifier, getArchiveTimeStampContentInfo, getAttributeHash, getEncoded, isAnyAttributeHashValid, isAttributeHashValid, isSigned, isUnique, validate, validate
Methods inherited from class br.ufsc.labsec.signature.conformanceVerifier.cades.attributes.TimeStamp
addUnsignedAttribute, buildTimeStampToken, compareTo, contentInfoToSignatureContainer, getAttributeList, getContentInfo, getEncodedAttribute, getEncodedAttribute, getTimeReference, removeUnsignedAttribute, replaceUnsignedAttribute
-
Field Details
-
IDENTIFIER
-
-
Constructor Details
-
IdAaEtsEscTimeStamp
public IdAaEtsEscTimeStamp(org.bouncycastle.asn1.cms.ContentInfo contentInfo) throws SignatureAttributeExceptionConstrói um objetoIdAaEtsEscTimeStamp
a partir de umContentInfo
.- Parameters:
contentInfo
- O conteúdo do carimbo do tempo- Throws:
SignatureAttributeException
-
IdAaEtsEscTimeStamp
public IdAaEtsEscTimeStamp(AbstractVerifier verifier, Integer index) throws SignatureAttributeExceptionDeve-se utilizar este construtor no momento de validação do atributo. O parâmetroindex
deve ser usado no caso em que há mais de um atributo do mesmo tipo. Caso contrário, ele deve ser zero.- Parameters:
verifier
- Usado para criar e verificar o atributoindex
- Índice usado para selecionar o atributo- Throws:
SignatureAttributeException
-
IdAaEtsEscTimeStamp
public IdAaEtsEscTimeStamp(org.bouncycastle.asn1.cms.Attribute genericEncoding) throws SignatureAttributeExceptionConstrói um objetoIdAaEtsEscTimeStamp
- Parameters:
genericEncoding
- O atributo codificado- Throws:
SignatureAttributeException
-
-
Method Details
-
getIdentifier
Retorna o identificador do atributo- Specified by:
getIdentifier
in interfaceSignatureAttribute<org.bouncycastle.asn1.cms.Attribute>
- Specified by:
getIdentifier
in classTimeStamp<org.bouncycastle.asn1.cms.Attribute>
- Returns:
- O identificador do atributo
-
getAttributeHash
protected byte[] getAttributeHash(String identifier, boolean hashWithoutTag) throws PbadException, NoSuchAlgorithmExceptionDescription copied from class:TimeStampToken
Calcula o hash do atributo- Specified by:
getAttributeHash
in classTimeStampToken
- Parameters:
identifier
- O algoritmo utilizadohashWithoutTag
- Indica a forma de cálculo da hash, de acordo com as notas 2 e 3 da pagina 109 do ETSI TS 101 733 V2.2.1. Se verdadeiro indica que o calculo é feito sem incluir tag e length.- Returns:
- O valor de hash do atributo
- Throws:
PbadException
- Exceção em caso de erro durante o cálculoNoSuchAlgorithmException
-
isAttributeHashValid
- Specified by:
isAttributeHashValid
in classTimeStampToken
-
makeTimeStampVerifier
protected TimeStampVerifier makeTimeStampVerifier(org.bouncycastle.tsp.TimeStampToken timeStamp, boolean containsRefsTimestamp, boolean containsArchiveTimestamp)Obtém umTimeStampVerifier
.- Overrides:
makeTimeStampVerifier
in classTimeStampToken
- Returns:
- O objeto
TimeStampVerifier
criado
-