Search code examples
bouncycastle

How to rewite CMSSignedDataGenerator to change SignedContentTypeOID?


Recently,I used CMSSignedDataGenerator to sign message,I found that SignedContentTypeOID is 1.2.840.113549.1.7.1,I want to rewrite CMSSignedDataGenerator to change SignedContentTypeOID from 1.2.840.113549.1.7.1 to 1.2.156.10197.6.1.4.2.2,coule someone can help me?

enter image description here

the result


Solution

  • The CMSTypedData subclass passed to CMSSignedDataGenerator.generate should let you specify an explicit content type.