Read Certificate in java written by safenet client

Hi All,
I need to develop a simple java application that connects to a smartcard which has a card with a certificate written by a SafeNet Client.
I tried using smartcardio and I successfully managed to view that the card is inserted and read its ATR. But is was not able to find a correct ADPU bytes array that will help me to somehow read the certificate stored on the card.
Any thought will be highly appreciated.
Many thanks,
Mihai.

Hello,
not sure if you really need to use ow-level APDU commandos to a smartcard, while there are Java compatible API's available. On the other hand SafeNet is very restrictive when it comes down to provide the APDU's for most of their cards.
I would recommend a different approach, most cards ship with a middleware that offers JCA/JCE security providers, from whom it is very easy to grab a certificate and do whatever operation that is required with the related keys. If there is no JCA/JCE provider available, you could use the PKCS#11 provider and hook it to java using SunPKCS.
Of course that would require to install SafeNets Authentication Client to provide the middle-ware, which might not be available on some exotic OS'es.
Which specific card modell are you talking about?
Kind Regards
Andreas

Similar Messages

  • Step by Step instructions importing Client Certificates on Java Engine

    Hi All,
    I am trying to configure a <b>Receiver</b> SOAP adapter with SSL, does anybody has step-by-step procedure on how to install the client certificates on Java Engine using Visual Administrator? and refer that keystore in SOAP adapter?
    PI 7.0 SP 09
    UNIX-Sun Soloris.
    Thanks,
    Laxman

    Hey Molugu,
    you shouldn't have to install the client certificates on KeyStorage Service, for receiver adapters. The server's public certificate is sent just in the SSL handshaking. What you should have is the certificate authorization tree in your Trusted ACs Service (if the issuer of your client's certificate is not already there).
    You need to install client certificates in sender adapters, when your client uses authentication through certificate. Then you need to install that authentication certificate for the authorized users.
    Check the following link for SSL on J2EE: http://help.sap.com/saphelp_nw2004s/helpdata/en/f1/2de3be0382df45a398d3f9fb86a36a/frameset.htm
    Regards,
    Henrique.

  • Get Certificate in java Mapping

    Hi all,
    How can I get the certificate in java mapping to pass in my tag??
    Example:
    <ns0:certificate>MIICbzCCACegAWVVUUYBUYBuycuyguyUUYVUHvuyvBVUYVhvteTR+h898BIUuhOH90iuBIouiiuGhcdxwAuijnPOMoiu97tyUYGujhbhbiugg87UHVUHbuiybiiuhyrd4wjbJVUY</ns0:certificate>
    Regards,

    Hi RajendraBadi ,
    Thanks for your attention!!!!
    But in my case i need to pass the signature ( Array Bytes) into the tag.
    See the example below:
    - <ns0:requestTO xsi:type="ns0:RequestTO">
    <ns0:certificate
    xsi:type="xsd:base64Binary">MIICbzCCAVegAwIBAgICAPQwDQYJKoZIhvc
    NAQEFBQAwSDEmMCQGA1UEChMdRG9taW5pbyBTZWd1cmFuY2EgR1BTIF
    BBTUNBUlkxHjAcBgNVBAMTFUNlcnRpZmljYXRlIEF1dGhvcml0eTAeFw0wOT
    A4MTgxNTMyMjlaFw0xMDA4MTMxNTMyMjlaMB0xGzAZBgNVBAMTEjAyLjkx
    NC40NjAvMDAwMS01MDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAr
    iktfz/XXVpFc5h5sdu3cgGhKOiJVStLKAz/AsN/w7F0Od2EolVlohzK5lnoP+77
    SQTQrgjaFkvhssWAKw4lmAfyPaLtSAQ5MouNjYpf9c13Xrb+wReSEK8lZ1OU
    HkyDmQ4BJTqYjFpOf8TRt2JqaKLvKPuZwZU0BG3sLoW9MCAwEAAaMSM
    BAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3DQEBBQUAA4IBAQAcoDCX
    </ns0:certificate>
    <ns0:context xsi:type="xsd:string">Router</ns0:context>

  • How do we create self-signed certificate using java packages

    Hi All,
    I require some information on creating self-signed certificate using java packages.
    The java.security.cert.* package allows you to read Certificates from an existing store or a file etc. but there is no way to generate one afresh. See CertificateFactory and Certificate classes. Even after loading a certificate you cannot regenerate some of its fields to embed the new public key &#8211; and hence regenerate the fingerprints etc. &#8211; and mention a new DN. Essentially, I see no way from java to self-sign a certificate that embeds a public key that I have already generated.
    I want to do the equivalent of &#8216;keytool &#8211;selfcert&#8217; from java code. Please note that I am not trying to do this by using the keytool command line option &#8211; it is always a bad choice to execute external process from the java code &#8211; but if no other ways are found then I have to fall back on it.
    Regards,
    Chandra

    I require some information on creating self-signed certificate using java packages. Its not possible because JCE/JCA doesn't have implementation of X509Certificate. For that you have to use any other JCE Provider e.g. BouncyCastle, IAIK, Assembla and etc.
    I'm giving you sample code for producing self-signed certificate using IAIK JCE. Note that IAIK JCE is not free. But you can use BouncyCastle its open source and free.
    **Generating and Initialising the Public and Private Keys*/
      public KeyPair generateKeys() throws Exception
          //1 - Key Pair Generated [Public and Private Key]
          m_objkeypairgen = KeyPairGenerator.getInstance("RSA");
          m_objkeypair = m_objkeypairgen.generateKeyPair();
          System.out.println("Key Pair Generated....");
          //Returns Both Keys [Public and Private]*/
          return m_objkeypair;
    /**Generating and Initialising the Self Signed Certificate*/
      public X509Certificate generateSSCert() throws Exception
        //Creates Instance of X509 Certificate
        m_objX509 = new X509Certificate();
        //Creatting Calender Instance
        GregorianCalendar obj_date = new GregorianCalendar();
        Name obj_issuer = new Name();
        obj_issuer.addRDN(ObjectID.country, "CountryName");
        obj_issuer.addRDN(ObjectID.organization ,"CompanyName");
        obj_issuer.addRDN(ObjectID.organizationalUnit ,"Deptt");
        obj_issuer.addRDN(ObjectID.commonName ,"Valid CA Name");
        //Self Signed Certificate
        m_objX509.setIssuerDN(obj_issuer); // Sets Issuer Info:
        m_objX509.setSubjectDN(obj_issuer); // Sets Subjects Info:
        m_objX509.setSerialNumber(BigInteger.valueOf(0x1234L));
        m_objX509.setPublicKey(m_objkeypair.getPublic());// Sets Public Key
        m_objX509.setValidNotBefore(obj_date.getTime()); //Sets Starting Date
        obj_date.add(Calendar.MONTH, 6); //Extending the Date [Cert Validation Period (6-Months)]
        m_objX509.setValidNotAfter(obj_date.getTime()); //Sets Ending Date [Expiration Date]
        //Signing Certificate With SHA-1 and RSA
        m_objX509.sign(AlgorithmID.sha1WithRSAEncryption, m_objkeypair.getPrivate()); // JCE doesn't have that specific implementation so that why we need any //other provider e.g. BouncyCastle, IAIK and etc.
        System.out.println("Start Certificate....................................");
        System.out.println(m_objX509.toString());
        System.out.println("End Certificate......................................");
        //Returns Self Signed Certificate.
        return m_objX509;
      //****************************************************************

  • What language is JAVA written in?

    Hi,
    What language is JAVA written in? Please give me a simple and short answer for my question.
    God Bless,
    Bruce

    Most of the Java Libraries (java.lang.*, java.util.*, etc) and other APIs are written in Java.
    The compiler can be written in Java, but I think that most are probably written in a native language. The compiler turns your .java files into bytecode, which can then be read by ANY JVM, regardless of the platfrom.
    The JVM will always be written in some native language. On Windows systems, that will usually be C/C++, while on IBM mainframes it can vary. The JVM is in a native language because it is what's responsible for "translating" the compiled bytecode into machine language that the platform can understand.
    .java text files are platform-independent.
    .class bytecode files are platform independent.
    Most APIs (except ones that do platfrom specific actions) are platform independent bytecode.
    The JVM is native code, because it is what turns all the platform independent code into something the native platform can read.
    This explanation is awfully general, but it should give you a good idea of how it all works.

  • How to read BLOBs as "Java.io.Reader"

    Hello,
    I have a problem dealing with BLOBs in JDBC. I want to get a BLOB as a "java.io.Reader". I have written the following code:
    class Db_templates {
    public static Reader select(int tpl_id) {
    try {
    Connection connection = ... ;
    Reader retour = null;
    String strSQL = "SELECT tpl_blob FROM templates WHERE tpl_id = ?";
    PreparedStatement ps = connection.prepareStatement(strSQL);
    ps.setInt(1, tpl_id);
    ResultSet rset = ps.executeQuery();
    if (rset.next()) {
    oracle.sql.BLOB blob = (BLOB)rset.getObject(1);
    retour = blob.characterStreamValue();
    rset.close();
    ps.close();
    connection.close();
    return retour;
    } catch (SQLException e) {
    return null;
    Then I try to call this method in a JSP file (Tomcat 4.0 as JSP container) with the following lines:
    Reader i = Db_templates.select(42);
    out.println(i.ready());
    char buf[] = new char[1000];
    try {
    int retour = i.read(buf, 1, 900);
    } catch (IOException e) {
    out.println(e.toString());
    The method i.ready() returns false with no IOException thrown.
    The method i.read() fails to execute with the following errors:
    java.lang.NullPointerException
    at oracle.sql.LobPlsqlUtil.plsql_read(LobPlsqlUtil.java:911)
    at oracle.sql.LobPlsqlUtil.plsql_read(LobPlsqlUtil.java:52)
    at oracle.jdbc.dbaccess.DBAccess.lobRead(DBAccess.java:658)
    at oracle.sql.LobDBAccessImpl.getBytes(LobDBAccessImpl.java:95)
    at oracle.sql.BLOB.getBytes(BLOB.java:175)
    at oracle.jdbc.driver.OracleBlobInputStream.needBytes(OracleBlobInputStream.java:126)
    at oracle.jdbc.driver.OracleBufferedStream.read(OracleBufferedStream.java:108)
    at oracle.jdbc.driver.OracleConversionReader.needChars(OracleConversionReader.java:151)
    at oracle.jdbc.driver.OracleConversionReader.read(OracleConversionReader.java:119)
    at org.apache.jsp.essai2$jsp._jspService(essai2$jsp.java:87)
    Any ideas?
    Thanks,
    Nicolas

    Normally, Firefox has two different behaviors for the down arrow key, assuming it is not inside a form control:
    * Scroll the page
    * With caret browsing turned on, move the cursor down one line
    If you are accustomed to the down arrow key moving among search results so you can press the Enter key to load them, and you are using Google, this is due to a script in the results page intercepting those keys and changing what they normally do.
    I have only tested Windows myself, so I don't know whether this is generally available when using Google in your distribution of Linux. If it is, then the question would be: why not on your Firefox? Hmm...

  • Is Java written in Java?

    Is Java written in Java?

    No, Java is a platform. Sun say so. Must be true.
    http://java.sun.com/java2/whatis/
    That link also says that Java is a programming language.
    When people talk about "Java", they generally are talking about the Java language.

  • [svn:bz-trunk] 23521: Bug#3141860: Unable to get a Java exception on flex client when legacy-throwable is set to true

    Revision: 23521
    Revision: 23521
    Author:   [email protected]
    Date:     2012-03-29 03:03:13 -0700 (Thu, 29 Mar 2012)
    Log Message:
    Bug#3141860: Unable to get a Java exception on flex client when legacy-throwable is set to true
    Removed the infinite loop that is encountered while returning the exception information. Adding fix to the BlazeDS trunk as well.
    Checkin-Tests: PASS
    QA: Yes
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/io/StatusInfoProxy.java

    Did you found the solution?

  • Certificate between Access point and Wireless client

    Hi;
    is there anyway to configure a certificate between the wireless AP and clients to secure my username and the password.
    my setup is WLC5508/AP1142/ACS5.4
    I need the client to trust  the certifcate before entering the UN/PW

    Hello,
    As per your query i can suggest you the following solution-
    LAP authorization can be performed in two ways:
    Using the Internal Authorization list on the WLC
    Using the MAC address database on an AAA server
    The behaviors of the LAPs differ based on the certificate used:
    LAPs with SSCs—The WLC will only use the Internal Authorization list and will not forward a request to a RADIUS server for these LAPs.
    LAPs with MICs—WLC can use either the Internal Authorization list configured on the WLC or use a RADIUS server to authorize the LAPs
    This document discusses LAP authorization using both the Internal Authorization list and the AAA server.
    For more information refer to the link-
    http://www.cisco.com/en/US/products/ps6366/products_configuration_example09186a00808c7234.shtml
    http://technet.microsoft.com/en-us/library/cc759077(v=ws.10).aspx
    Hope this will help you.

  • JAVA written practical test

    Hi
    I don't quite know where to put this thread, but I am looking for a downloadable java written practical test. We are in the process of employing some new staff and we need a test of some sorts to gauge the skills.
    Actually any kind of JAVA test would be appreciated
    Thanks

    I don't quite know where to put this thread, but I am
    looking for a downloadable java written practical
    test. We are in the process of employing some new
    staff and we need a test of some sorts to gauge the
    skills.
    Actually any kind of JAVA test would be appreciatedJust search Google for "mock SJCP exam". And if you really want to use it for employment test: stop testing for Java knowledge and start testing for programing skills. Those things are rather unrelated, and the latter surely is more important.

  • Problem while Consuming Java Webservice from WCF client

    Hi,
    I am trying to Consume Java Webservice from WCF client.The webservice main functionality is digital data management.The client can Query Digital data and upload digital data by calling webservice methods.Problem is when i am trying to call webmethod from WCF client its giving "Unrecognised message versions".I have no idea about how the message objects are processed at serverside.but at server side they have used JAXP for XML document parsing.
    The response content type is Multipart/related and applicatio/XOP+XML.
    Can u plz help me how to handle this situation.I have minimum knowledge in Java WS architecture.Basically i am .Net programmer.
    Can U please guide me in a proper way to resolve the problem.

    Hi Abinash,
    I have the same problem. Have you solve that problem?
    I am using a java program to call a webservice too. And I have generated the client proxy definition for Stand alone proxy using NWDS. When I call the method of the webservice I am getting the correct result but along with the result I am getting one error and one warning message in the output.
    The java code to call the webservice is as follows.
    MIDadosPessoaisSyncService service = new MIDadosPessoaisSyncServiceImpl();
    MIDadosPessoaisSync port = service.getLogicalPort("MIDadosPessoaisSyncPort");
    port._setProperty("javax.xml.rpc.security.auth.username","xpto");
    port._setProperty("javax.xml.rpc.security.auth.password","xpto");
    String out = port.MIDadosPessoaisSync("xpto", "xpto");
    System.out.println(out);
    The result I am getting is :
    Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtocol] could not be loaded (NoClassDefFoundError) !
    Error Message is :com/sap/guid/GUIDGeneratorFactory
    <b>The result of the WS is correct!!!</b>
    The Java project does not have any warning. But the stand alone proxy project has following warnings associated with it.
    This method has a constructor name     MIDadosPessoaisSync.java     
    The import javax.xml.rpc.holders is never used     MIDadosPessoaisSyncBindingStub.java     
    The import javax.xml.rpc.encoding is never used     MIDadosPessoaisSyncBindingStub.java     
    The constructor BaseRuntimeException(ResourceAccessor, String, Throwable) is deprecated     MIDadosPessoaisSyncBindingStub.java
    It is very similar with your problem, could you help me?
    Thanks
    Gustavo Freitas

  • How to read card reader (bar code reader) in simple java program ?

    hai all
    how to manipulate (read/write) card readers (or bar code reader ) in
    a java program ?
    should i import any particular package library ?
    pls give me any sample code or tutorials or tools, etc (whatever you have) .
    i am new to this card reader category
    its very urgent
    thank you .

    Nearly all card readers and barcode readers I've ever seen simply stick their input right onto stdin, so you can capture it just as if it had been typed in on a keyboard

  • Can I include a text file to read from within java?

    I have a config file I need to read within a java program called config.xml.
    I want to reference this document, but don't now how to without using '..new(File("config.xml"))' and this forces me to put it in a directory somewhere.
    I just want to reference it from a jar file. For example, if I put it in a jar called config.jar, and added that to my CP - how do I reference it?
    THanks

    Great - thanks.
    One more question - Is configs in this case a java package that I would inlclude with my other packages?
    For example, my main package is: main - it contains several packages with all my code. - I created a new folder in my Jbuilder environment in the same directory as the main package - called in configs - then put the config.xml file in there. If I add the package configs - it doesn't show the conifg.xml within the tree viewer of Jbuilder...do I need to put a package identification at the top of the XML file like in Java - somehting like package main.configs?
    THanks, again

  • Apache 2.0.59 - cannot read certificate revocation list

    Hello,
    i've installed a thawte SSL certificate on a Netware 6.5 SP7 server with apache 2.0.59. If i want to validate the certificate with C1, i get the following error "cannot read certificate revocation list" ! I've found in a forum task, that this is not a great problem, but when i remark the command "SecureListen 443 "new-NDS-name" in http.conf from apache, then the webserver cannot start. Error in apache log is "[Wed Jan 05 15:57:42 2011] [crit] (10043)Unknown error: make_secure_socket: failed to get a socket for port 443 Configuration Failed". I've found in novell support forum the following task - Error: Invalid cannot read certificate revocation list. I contact thawte and they told me the following - All of our Thawte certificates are issued a CRL to check. We do not have any process or way to issue a certificate without the use of the CRL. Unfortunately no, as almost all CA's will use a CRL to ensure that the certificate's validity and status is always up to date.
    What can i do ? Does anyone has an idea ? It was great to get it running......
    Regards,
    Norbert

    NSuttner,
    > with apache 2.0.59. If i want to validate the certificate with C1, i get
    > the following error "cannot read certificate revocation list" ! I've
    >
    FWIW, I have always regarded that as cosmetic (TID 10094995). Ie I sometimes get errors in C1, even if the certs are fine.
    Your message indicates that you did not get the complete certificate list. Ie you need to have your cert, the trusted root and all intermediaries. Sometimes you have to import them all into Ie, then export the complete list
    http://www.novell.com/support/php/se...00%20195481184
    THE TID to read is:
    http://www.novell.com/support/php/se...00%20195481155
    and:
    http://www.novell.com/support/php/se...00%20195481134
    Also see:
    http://www.novell.com/support/php/se...00%20195481082
    - Anders Gustafsson (Sysop)
    The Aaland Islands (N60 E20)
    Novell has a new enhancement request system,
    or what is now known as the requirement portal.
    If customers would like to give input in the upcoming
    releases of Novell products then they should go to
    http://www.novell.com/rms

  • Installing Java Development Pieces on Client

    How do I install the missing java pieces on the client machine without installing an entire workflow/database instance?
    I've installed Workflow 2.6.2 on a Linux server. I've installed the 9.0.2 client on my Windows laptop. I can connect to the server with workflow builder, etc.
    Only problem is that none of the Java development pieces were installed on the client. So I cannot, for example, compile the WFTest.java application.

    Robert,
    You can copy the Jar files from your linux install onto your client oracle home.
    Check OH/jlib for the jar files.
    Cheers,
    Raja

Maybe you are looking for