Skip to content
Advertisement

org.bouncycastle.cms.CMSException: content-type attribute value does not match eContentType

I’m currently building a TimeStamp server using BouncyCastle. Server is working well but on the client side, when I want to validate the TimeStampResponse received I’m getting the following error:

org.bouncycastle.cms.CMSException: content-type attribute value does not match eContentType

On the server side, I’m including the content-type attribute like this:

JavaScript

and on the client side:

JavaScript

It seems that I include correctly the content-type in my TimeStampToken (“1.2.840.113549.1.7.1”) but I don’t know where is the eContentType and don’t know where I can check it.

EDIT 1: May be I’m not clear in my answer…I’ll try to reformulate… How can I access eContentType of a TimeStampToken ?

What BouncyCastle is comparing ?

Advertisement

Answer

After multiple readings, I’ve seen that adding contentType Attribute is making this kind of error, as I’m already building the TimeStampResponse based on the request, the content type is already taken into account.

It make a conflict on the BouncyCastle Library, so by removing the line :

JavaScript

everything works fine, my TimeStampResponse is validated correctly.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement