Class JAdESTProfile
java.lang.Object
br.ufsc.labsec.signature.conformanceVerifier.signaturePolicy.decoder.Profile<JadesAttrCommonStruct,JadesSignature>
br.ufsc.labsec.signature.conformanceVerifier.signaturePolicy.decoder.JAdESProfiles.JAdESTProfile
- All Implemented Interfaces:
SignaturePolicyInstance
public class JAdESTProfile extends Profile<JadesAttrCommonStruct,JadesSignature>
-
Nested Class Summary
Nested classes/interfaces inherited from class br.ufsc.labsec.signature.conformanceVerifier.signaturePolicy.decoder.Profile
Profile.AdESLevel, Profile.AdESType
-
Field Summary
Fields Modifier and Type Field Description static Profile<JadesAttrCommonStruct,JadesSignature>
PROFILE
Fields inherited from class br.ufsc.labsec.signature.conformanceVerifier.signaturePolicy.decoder.Profile
conditionalSignedAttributeList, conditionalUnsignedAttributeList, mandatedConditionalSignedAttributeList, mandatedSignedAttributeList, mandatedUnsignedAttributeList, prohibitedSignedAttributeList, prohibitedUnsignedAttributeList
-
Constructor Summary
Constructors Constructor Description JAdESTProfile()
-
Method Summary
Modifier and Type Method Description Profile.AdESLevel
getAdESLevel()
Retorna o tipo do perfilProfile.AdESType
getAdESType()
Retorna o tipo da política.AlgorithmIdentifier
getAlgorithmIdentifier()
Retorna o atributoSignPolicyHashAlg
.byte[]
getEncoded()
Retorna os bytes da políticabyte[]
getEncodedHash(String algorithm)
byte[]
getExpectedSignPolicyInfoHash()
Retorna o atributoSignPolicyHash
.String
getNormativeReference()
String
getSignPolicyIdentifier()
Retorna o oid da política.List<String>
getWarningAttributeList()
Método que retorna a lista de atributos que geram warningsboolean
isAtLeast(Profile.AdESLevel level)
boolean
isFound()
Informa se a política está corretamente definidaboolean
isXML()
Verifica se a Política de Assinatura é XMLboolean
validateHash()
verifica o resumo criptográfico do SignPolicyInfo da políticaorg.apache.commons.lang3.tuple.Pair<Boolean,List<String>>
validateMandatoryConditionals(Signature<JadesAttrCommonStruct> signature, List<String> attrList)
Methods inherited from class br.ufsc.labsec.signature.conformanceVerifier.signaturePolicy.decoder.Profile
addMandatoryConditionals, getAdES, getIdentifier, getMandatedConditionalSignedAttributeList, getMandatedSignedAttrs, getMandatedUnsignedAttributeList, getMandatedUnsignedAttrs, getProhibitedSignedAttrs, getProhibitedUnsignedAttrs, getSignaturePolicyName, getSignaturePolicyType, getSignatureValidationPolicy, isInstanceOf, loadAttributes, validate, validateMandatoryConditionalsLocal
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
isNotFound
-
Field Details
-
PROFILE
-
-
Constructor Details
-
JAdESTProfile
public JAdESTProfile()
-
-
Method Details
-
isAtLeast
- Specified by:
isAtLeast
in classProfile<JadesAttrCommonStruct,JadesSignature>
- Parameters:
level
-- Returns:
-
getAdESType
Retorna o tipo da política.- Returns:
- tipo da política
-
getAdESLevel
Description copied from interface:SignaturePolicyInstance
Retorna o tipo do perfil- Specified by:
getAdESLevel
in interfaceSignaturePolicyInstance
- Specified by:
getAdESLevel
in classProfile<JadesAttrCommonStruct,JadesSignature>
- Returns:
-
getAlgorithmIdentifier
Retorna o atributoSignPolicyHashAlg
.- Returns:
- O valor do atributo
-
getSignPolicyIdentifier
Retorna o oid da política.- Returns:
- O valor do oid da política
-
getExpectedSignPolicyInfoHash
public byte[] getExpectedSignPolicyInfoHash()Retorna o atributoSignPolicyHash
.- Returns:
- O valor do atributo
-
getEncoded
public byte[] getEncoded()Retorna os bytes da política- Returns:
- array de bytes da política
-
getEncodedHash
- Parameters:
algorithm
-- Returns:
- Throws:
NoSuchAlgorithmException
-
isFound
public boolean isFound()Informa se a política está corretamente definida- Returns:
- se a política está corretamente definida
-
isXML
public boolean isXML()Verifica se a Política de Assinatura é XML- Returns:
- Indica se a Política de Assinatura é XML
-
validateHash
public boolean validateHash() throws IOException, NoSuchAlgorithmException, TransformerFactoryConfigurationError, TransformerExceptionverifica o resumo criptográfico do SignPolicyInfo da política- Returns:
- verdadeiro se o resumo criptográfico ser o esperado
- Throws:
IOException
- Caso não seja possível ler os bytes da políticaNoSuchAlgorithmException
- Caso o algoritmo de resumo criptográfico esteja mal definidoTransformerFactoryConfigurationError
- Caso não seja possível transformar uma política em XMLTransformerException
- Caso não seja possível transformar uma política em XML
-
validateMandatoryConditionals
public org.apache.commons.lang3.tuple.Pair<Boolean,List<String>> validateMandatoryConditionals(Signature<JadesAttrCommonStruct> signature, List<String> attrList)- Specified by:
validateMandatoryConditionals
in classProfile<JadesAttrCommonStruct,JadesSignature>
-
getNormativeReference
- Specified by:
getNormativeReference
in classProfile<JadesAttrCommonStruct,JadesSignature>
-
getWarningAttributeList
Description copied from class:Profile
Método que retorna a lista de atributos que geram warnings- Specified by:
getWarningAttributeList
in classProfile<JadesAttrCommonStruct,JadesSignature>
- Returns:
- lista de atributos que geram warnings
-