Class XmlSignaturePolicy
java.lang.Object
br.ufsc.labsec.signature.conformanceVerifier.signaturePolicy.decoder.SignaturePolicy
br.ufsc.labsec.signature.conformanceVerifier.signaturePolicy.decoder.XmlSignaturePolicy
- All Implemented Interfaces:
SignaturePolicyInstance
,Cacheable
public class XmlSignaturePolicy extends SignaturePolicy
-
Field Summary
Fields inherited from class br.ufsc.labsec.signature.conformanceVerifier.signaturePolicy.decoder.SignaturePolicy
algorithmIdentifier, encoded, encodedHash, expectedSignPolicyInfoHash, policyNameInUri, signaturePolicyInfo
-
Constructor Summary
Constructors Constructor Description XmlSignaturePolicy(byte[] encoded)
XmlSignaturePolicy(Document xmlEncoded)
Construtor usado para decodificar um atributo de uma política XML. -
Method Summary
Modifier and Type Method Description Profile.AdESLevel
getAdESLevel()
Retorna o tipo do perfilboolean
hasTransforms()
Verifica se existe o atributoTransforms
.boolean
isXML()
Verifica se a Política de Assinatura é XMLboolean
validateHash()
verifica o resumo criptográfico do SignPolicyInfo da políticaboolean
validateHash(Document document, String algorithm, byte[] expected)
Methods inherited from class br.ufsc.labsec.signature.conformanceVerifier.signaturePolicy.decoder.SignaturePolicy
getAdESType, getAdESType, getAlgorithmIdentifier, getEncoded, getEncodedHash, getExpectedSignPolicyInfoHash, getSignaturePolicyName, getSignaturePolicyType, getSignatureValidationPolicy, getSignPolicyIdentifier, isFound, setEncoded, setSignaturePolicyName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface br.ufsc.labsec.signature.conformanceVerifier.signaturePolicy.decoder.SignaturePolicyInstance
getBytes, getCacheKey, isNotFound
-
Constructor Details
-
XmlSignaturePolicy
public XmlSignaturePolicy(byte[] encoded) throws ParserConfigurationException, IOException, SAXException, CertificateException, ParseException -
XmlSignaturePolicy
public XmlSignaturePolicy(Document xmlEncoded) throws DOMException, ParseException, CertificateExceptionConstrutor usado para decodificar um atributo de uma política XML.- Parameters:
xmlEncoded
- elemento XML que representa o atributoSignaturePolicy
.- Throws:
DOMException
- Exceção em caso de erro no elemento XMLParseException
- Exceção em caso de erro no parsing da data no atributoCertificateException
- Exceção em caso de erro na codificação do certificado
-
-
Method Details
-
getAdESLevel
Description copied from interface:SignaturePolicyInstance
Retorna o tipo do perfil- Returns:
- tipo do perfil
-
isXML
public boolean isXML()Description copied from class:SignaturePolicy
Verifica se a Política de Assinatura é XML- Specified by:
isXML
in interfaceSignaturePolicyInstance
- Specified by:
isXML
in classSignaturePolicy
- Returns:
- Indica se a Política de Assinatura é XML
-
hasTransforms
public boolean hasTransforms()Verifica se existe o atributoTransforms
.- Returns:
- Indica se o atributo não é nulo.
-
validateHash
public boolean validateHash()Description copied from class:SignaturePolicy
verifica o resumo criptográfico do SignPolicyInfo da política- Specified by:
validateHash
in interfaceSignaturePolicyInstance
- Specified by:
validateHash
in classSignaturePolicy
- Returns:
- verdadeiro se o resumo criptográfico ser o esperado
-
validateHash
-