Class SignatureTimeStamp
java.lang.Object
br.ufsc.labsec.signature.conformanceVerifier.jades.attributes.TimeStamp
br.ufsc.labsec.signature.conformanceVerifier.jades.attributes.unsigned.SignatureTimeStamp
- All Implemented Interfaces:
SignatureAttribute<JadesAttrCommonStruct>
- Direct Known Subclasses:
AllDataObjectsTimeStamp
,ArchiveTimeStamp
,RefsOnlyTimeStamp
,SigAndRefsTimeStamp
public class SignatureTimeStamp extends TimeStamp implements SignatureAttribute<JadesAttrCommonStruct>
-
Field Summary
Fields Modifier and Type Field Description static String
CANON_ALG
static String
ENCODING
static String
IDENTIFIER
Entrada no cabeçalho que relacionam o SigningCertificateprotected JadesVerifier
signatureVerifier
Verificador de assinatura JWSstatic String
SPEC_REF
static String
TST_TOKENS
static String
TYPE
static String
VAL
Fields inherited from class br.ufsc.labsec.signature.conformanceVerifier.jades.attributes.TimeStamp
canonicalizationAlgorithm, stamps
-
Constructor Summary
Constructors Constructor Description SignatureTimeStamp(Verifier signatureVerifier, org.json.JSONObject protectedHeader, org.json.JSONObject unprotectedHeader)
SignatureTimeStamp(String type, String encoding, String specRef, org.bouncycastle.asn1.cms.ContentInfo contentInfo, String canonAlg)
SignatureTimeStamp(List<TstToken> tokens, String canonAlg)
SignatureTimeStamp(org.bouncycastle.asn1.cms.ContentInfo contentInfo)
-
Method Summary
Modifier and Type Method Description protected void
decode(org.json.JSONObject header, JadesVerifier.JsonStructureFinder jsonStructureFinder)
protected void
decode(org.json.JSONObject header, String extension, JadesVerifier.JsonStructureFinder jsonStructureFinder)
protected void
decodeValues(org.json.JSONObject sigTS)
JadesAttrCommonStruct
getEncoded()
Retorna o atributo codificadoprotected byte[]
getHashFromSignature(String hashAlgorithmId)
Calcula o hash do atributoString
getIdentifier()
Retorna o identificador do atributoJadesVerifier
getJadesVerifier()
protected boolean
isLast(TstToken token)
Verifica se o atributo é o último carimbo na assinaturaboolean
isSigned()
Informa se o atributo é assinadoboolean
isUnique()
Informa se o atributo deve ter apenas uma instância na assinaturavoid
validate()
Valida o atributo de acordo com suas regras específicas (ver normas do ETSI para cada atributo).
-
Field Details
-
IDENTIFIER
Entrada no cabeçalho que relacionam o SigningCertificate- See Also:
- Constant Field Values
-
CANON_ALG
- See Also:
- Constant Field Values
-
TST_TOKENS
- See Also:
- Constant Field Values
-
TYPE
- See Also:
- Constant Field Values
-
ENCODING
- See Also:
- Constant Field Values
-
SPEC_REF
- See Also:
- Constant Field Values
-
VAL
- See Also:
- Constant Field Values
-
signatureVerifier
Verificador de assinatura JWS
-
-
Constructor Details
-
SignatureTimeStamp
public SignatureTimeStamp(Verifier signatureVerifier, org.json.JSONObject protectedHeader, org.json.JSONObject unprotectedHeader) -
SignatureTimeStamp
public SignatureTimeStamp(org.bouncycastle.asn1.cms.ContentInfo contentInfo) throws SignatureAttributeException- Throws:
SignatureAttributeException
-
SignatureTimeStamp
public SignatureTimeStamp(String type, String encoding, String specRef, org.bouncycastle.asn1.cms.ContentInfo contentInfo, String canonAlg) throws SignatureAttributeException- Throws:
SignatureAttributeException
-
SignatureTimeStamp
public SignatureTimeStamp(List<TstToken> tokens, String canonAlg) throws SignatureAttributeException- Throws:
SignatureAttributeException
-
-
Method Details
-
decode
protected void decode(org.json.JSONObject header, String extension, JadesVerifier.JsonStructureFinder jsonStructureFinder) -
decode
protected void decode(org.json.JSONObject header, JadesVerifier.JsonStructureFinder jsonStructureFinder) -
decodeValues
protected void decodeValues(org.json.JSONObject sigTS) -
validate
Valida o atributo de acordo com suas regras específicas (ver normas do ETSI para cada atributo).- Specified by:
validate
in interfaceSignatureAttribute<JadesAttrCommonStruct>
- Throws:
SignatureAttributeException
PbadException
-
getEncoded
Retorna o atributo codificado- Specified by:
getEncoded
in interfaceSignatureAttribute<JadesAttrCommonStruct>
- Returns:
- O atributo no formato descrito pelas normas do ETSI e RFCs
- Throws:
SignatureAttributeException
-
isSigned
public boolean isSigned()Informa se o atributo é assinado- Specified by:
isSigned
in interfaceSignatureAttribute<JadesAttrCommonStruct>
- Specified by:
isSigned
in classTimeStamp
- Returns:
- Indica se o atributo é assinado
-
getJadesVerifier
- Specified by:
getJadesVerifier
in classTimeStamp
-
isUnique
public boolean isUnique()Informa se o atributo deve ter apenas uma instância na assinatura- Specified by:
isUnique
in interfaceSignatureAttribute<JadesAttrCommonStruct>
- Returns:
- Indica se o atributo deve ter apenas uma instância na assinatura
-
getIdentifier
Retorna o identificador do atributo- Specified by:
getIdentifier
in interfaceSignatureAttribute<JadesAttrCommonStruct>
- Specified by:
getIdentifier
in classTimeStamp
- Returns:
- O identificador do atributo
-
getHashFromSignature
Calcula o hash do atributo- Specified by:
getHashFromSignature
in classTimeStamp
- Parameters:
hashAlgorithmId
- O algoritmo utilizado- Returns:
- O valor de hash do atributo
- Throws:
PbadException
- Exceção em caso de erro durante o cálculo
-
isLast
Verifica se o atributo é o último carimbo na assinatura- Specified by:
isLast
in classTimeStamp
- Returns:
- Indica se o carimbo é o último na assinatura
- Throws:
TimeStampException
-