Click here to Skip to main content
15,991,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to subclass some BC classes, in my Java project, but I faced issue with import of CMSUtils class. In order to reproduce issue in a simple project, I created quick-start Maven project (Eclipse 2024-06 IDE). Here are some details:

in pom.xml:

<dependency>
   <groupId>org.bouncycastle</groupId>
   <artifactId>bcpkix-jdk18on</artifactId>
   <version>1.78.1</version>
 </dependency>

 <dependency>
   <groupId>org.bouncycastle</groupId>
   <artifactId>bcprov-jdk18on</artifactId>
   <version>1.78.1</version>
 </dependency>

 <dependency>
   <groupId>org.bouncycastle</groupId>
   <artifactId>bcutil-jdk18on</artifactId>
   <version>1.78.1</version>
 </dependency>

In .java file:

package com.marcony.newpdfsign;


import org.bouncycastle.cms.CMSTypedStream;
import org.bouncycastle.cms.CMSUtils;

/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}

So, on CMSUtils import, IDE reports: The type org.bouncycastle.cms.CMSUtils is not visible. On the other hand, it does not complain on other import, which is here only to show that other class from same .jar is visible.

What I have tried:

I looked at content of bcpkix-jdk18on-1.78.1.jar file, and can see both classes.

Any idea what's wrong here?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900