Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8486569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:58:53+00:00 2026-06-10T20:58:53+00:00

I am working on SignerTTest.java with SignerTestBase : public class SignerTestBase extends SignatureServicesTestBase {

  • 0

I am working on SignerTTest.java with “SignerTestBase” :

    public class SignerTestBase extends SignatureServicesTestBase
{
    /**/
    static protected KeyingDataProvider keyingProviderMy;
    static protected KeyingDataProvider keyingProviderNist;

    static
{
    try
    {
        keyingProviderMy = createFileSystemKeyingDataProvider("pkcs12", "my/LG.pfx", "mykeypass", true);
        keyingProviderNist = createFileSystemKeyingDataProvider("pkcs12", "csrc.nist/test4.p12", "password", false);
    } catch (KeyStoreException e)
    {
        throw new NullPointerException("SignerTestBase init failed: " + e.getMessage());
    }
}

public static Document getTestDocument() throws Exception
{
    //return getDocument("document.xml");

    //==that I changed=====================================================================
    return getDocument("fv.xml");


}

I have the class SignerTTest.java

@Test
public void testSignTPtCC() throws Exception
{
    System.out.println("signTPtCitizenCard");

    if (!onWindowsPlatform())
        fail("Test written for the Windows platform");

    Document doc = getTestDocument();
    Element elemToSign = doc.getDocumentElement();
    try
    {
        PKCS11KeyStoreKeyingDataProvider ptccKeyingDataProv = new PKCS11KeyStoreKeyingDataProvider(
                //"C:\\Windows\\System32\\pteidpkcs11.dll", "PT_CC",
                "C:\\Windows\\system32\\pteidpkcs11.dll", "PT_CC",


                new FirstCertificateSelector(), null, null, false);

        SignerT signer = (SignerT)new XadesTSigningProfile(ptccKeyingDataProv).withAlgorithmsProvider(PtCcAlgorithmsProvider.class).newSigner();
        new xades4j.production.Enveloped(signer).sign(elemToSign);

        outputDocument(doc, "document.signed.t.bes.ptcc.xml");
    } catch (ProviderException ex)
    {
        fail(" !!!!!!!PT CC PKCS#11 provider not configured !!!!!!!!!!!!");
    }
}

And in my main.class :

 System.out.println("============================================================================");          
        System.out.println("XADESTEST : T SIGNATURE");
        System.out.println("============================================================================");
        System.out.println();

        SignerTTest signerTTest = new SignerTTest();
        System.out.println("signerTTest : " + signerTTest.toString()); 

        /**
         *    ==== NOT OK =====
         */
        signerTTest.testSignTPtCC();

And in my console I get :

> ============================================================================
XADESTEST : T SIGNATURE
============================================================================

signerTTest : xadestest.SignerTTest@1304043
signTPtCitizenCard
Exception in thread "main" java.lang.AssertionError:  !!!!!!!PT CC PKCS#11 provider not configured !!!!!!!!!!!!
    at org.junit.Assert.fail(Assert.java:58)
    at xadestest.SignerTTest.testSignTPtCC(SignerTTest.java:119)
    at xadestest.XadesTest.main(XadesTest.java:117)
Java Result: 1
BUILD SUCCESSFUL (total time: 3 seconds)

Please may you advice me on the problem during I am searching ?

thanks,

Will.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T20:58:55+00:00Added an answer on June 10, 2026 at 8:58 pm

    That test is written to use the Portuguese Citizen Card PKCS#11 provider. As the exception message states, you don’t have the provider installed. If you need to test the lib with a PKCS#11 provider, change the configuration to use its native lib instead.

    P.S.: the lib docs and examples are pretty clear on this..please take a better look. also, please vote the answers here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working in Java: I have a JFrame class, and separate classes for my two
Working with WCF how it should modify this DataContract or code: <DataContract()> Public Class
Working with jquery.ajax for first time... I have a class in C#: public class
Working with H2 I get this error when I try to write a row
Working on the problems on Project Euler to try to learn Clojure. I'm on
Working in Scala-IDE, I have a Java library, in which one of the methods
Working with some basic java apps on CentOS 5 linux and I have my
Working with chrome on ubuntu, have a basic java applet and javascript interaction. The
Working with Sharepoint 2010, I have a class that inherits SPPersistedObject with various settings:
Working live URL showing problem: http://69.24.73.172/demos/newDemo/test.html The HTML : <div class="small-vote"> <a href="#" class="s

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.