You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ao tentar validar um arquivo assinado cuja assinatura tem o atributo signing-time (OID 1.2.840.113549.1.9.5) no formato GeneralizedTime, que possui 4 dígitos para o ano, é lançada uma exceção com o seguinte erro:
class org.bouncycastle.asn1.ASN1GeneralizedTime cannot be cast to class org.bouncycastle.asn1.ASN1UTCTime
Ao que parece, a classe CAdESChecker (linha 271) supõe que este atributo estará no formato UTCTime, com dois dígitos no ano, e faz um cast explícito para a classe correspondente do bouncy castle:
Parece que o ideal seria conseguir identificar se deve fazer o cast para org.bouncycastle.asn1.ASN1GeneralizedTime ou org.bouncycastle.asn1.ASN1UTCTime, conforme o tipo do objeto em runtime, pois ambos têm um método getDate() disponível.
The text was updated successfully, but these errors were encountered:
Poderia anexar um documento com essa característica para que possamos testar e corrigir o código?
Ou se preferir, pode fazer a alteração, pode ser por comentário aqui mesmo ou um pull-request.
Ao tentar validar um arquivo assinado cuja assinatura tem o atributo signing-time (OID 1.2.840.113549.1.9.5) no formato GeneralizedTime, que possui 4 dígitos para o ano, é lançada uma exceção com o seguinte erro:
class org.bouncycastle.asn1.ASN1GeneralizedTime cannot be cast to class org.bouncycastle.asn1.ASN1UTCTime
Ao que parece, a classe CAdESChecker (linha 271) supõe que este atributo estará no formato UTCTime, com dois dígitos no ano, e faz um cast explícito para a classe correspondente do bouncy castle:
dataHora = (((ASN1UTCTime) timeAttribute.getAttrValues().getObjectAt(0)).getDate());
Parece que o ideal seria conseguir identificar se deve fazer o cast para
org.bouncycastle.asn1.ASN1GeneralizedTime
ouorg.bouncycastle.asn1.ASN1UTCTime
, conforme o tipo do objeto em runtime, pois ambos têm um métodogetDate()
disponível.The text was updated successfully, but these errors were encountered: