Class IdAaSignatureTimeStampToken
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.IdAaSignatureTimeStampToken
- All Implemented Interfaces:
SignatureAttribute<org.bouncycastle.asn1.cms.Attribute>
,Comparable<TimeStamp<org.bouncycastle.asn1.cms.Attribute>>
public class IdAaSignatureTimeStampToken extends TimeStampToken
Representa o carimbo do tempo da assinatura.
Oid e esquema do atributo id-aa-signatureTimeStampToken retirado do documento ETSI TS 101 733 V1.8.1:
id-aa-signatureTimeStampToken OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) id-aa(2) 14} SignatureTimeStampToken ::= 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 IdAaSignatureTimeStampToken(AbstractVerifier signatureVerifier, Integer index)
Deve-se utilizar este construtor no momento de validação do atributo.IdAaSignatureTimeStampToken(org.bouncycastle.asn1.cms.Attribute genericEncoding)
Constrói um objetoIdAaSignatureTimeStampToken
IdAaSignatureTimeStampToken(org.bouncycastle.asn1.cms.ContentInfo contentInfo)
Constrói um objetoIdAaSignatureTimeStampToken
a partir de umContentInfo
-
Method Summary
Modifier and Type Method Description protected byte[]
getAttributeHash(String identifier, boolean hashWithoutTag)
Calcula o hash do atributoString
getIdentifier()
Indica o identificador do atributo.protected 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
-
IdAaSignatureTimeStampToken
public IdAaSignatureTimeStampToken(AbstractVerifier signatureVerifier, 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:
signatureVerifier
- Usado para criar e verificar o atributoindex
- Índice usado para selecionar o atributo- Throws:
SignatureAttributeException
-
IdAaSignatureTimeStampToken
public IdAaSignatureTimeStampToken(org.bouncycastle.asn1.cms.Attribute genericEncoding) throws SignatureAttributeExceptionConstrói um objetoIdAaSignatureTimeStampToken
- Parameters:
genericEncoding
- O atributo codificado- Throws:
SignatureAttributeException
-
IdAaSignatureTimeStampToken
public IdAaSignatureTimeStampToken(org.bouncycastle.asn1.cms.ContentInfo contentInfo) throws SignatureAttributeExceptionConstrói um objetoIdAaSignatureTimeStampToken
a partir de umContentInfo
- Parameters:
contentInfo
- O conteúdo do carimbo do tempo- Throws:
SignatureAttributeException
-
-
Method Details
-
getIdentifier
Indica 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:
- Retorna "1.2.840.113549.1.9.16.2.14"
-
getAttributeHash
protected byte[] getAttributeHash(String identifier, boolean hashWithoutTag) throws NoSuchAlgorithmExceptionCalcula 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:
NoSuchAlgorithmException
-
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
-