How to specify alias name in system property while making 2way SSL con ?

Hi All,
I am tring to run a java client with 2way SSL which uses CAC card as keystore for the client. I have addded the following system property in my client program to make it work and change the java.security file to add pcks11 provider.
System.setProperty("javax.net.ssl.keyStoreType", "pkcs11");
System.setProperty("javax.net.debug", "ssl");
The program works fine and handshake is successfully done . But the problem is when i have more than one trusted certificate in the CAC card, it take a default certificate. I want to specify the certificate that should be used to do the client auth maybe specify the alias name . I didnt find any system property to do so.
Please let me know how to specify alias name as system property so that the 2way SSL used the specified alias for the client auth or is there any other way to specify the alias name. As in case i acccess the server URL from any browser i get a certificate selection prompt and the connection is established with the selected certificate.
Thanks in advanced,
Ruhul

I didn't find any system property to do so.There isn't one.
Please let me know how to specify alias name as system propertyYou can't.
You would have to write a custom KeyManager. See the JSSE Reference Guide.

Similar Messages

  • How to get alias name of stored certificate from iKey token 2032

    Hi All,
    Below is my code woks well to use the same keypair for both encrypt/decryprt-SunPKCS#11 in SDK1.5. In my code i hard coded alias name of certificate, kindly tell me how to read alias name of certificate from iKey token 2032??
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    import java.sql.*;
    import java.text.*;
    import java.math.*;
    import java.security.*;
    import java.security.cert.*;
    import java.security.interfaces.*;
    import javax.crypto.interfaces.*;
    import javax.net.ssl.*;
    import javax.crypto.*;
    import javax.crypto.spec.DESKeySpec;
    import java.security.KeyStore.*;
    public class Encrypt
    public Encrypt(){}
    public void loginToken() {
    Provider p = new sun.security.pkcs11.SunPKCS11(MQConfig.getvalue("SecurityPropertyPath"));
    String myAlias = "349eefd1-845b-4ba4-9f88-06e9f5cb82f6";
    /** to view alias name
    keytool -list -v -keystore NONE -storetype PKCS11 -storepass PASSWORD
    Security.addProvider(p);
    KeyStore ks = null;
    PrivateKey privKey = null;
    PublicKey pubKey = null;
    try{
    String password = General.ReadFiles(MQConfig.getvalue("logFilePath"),"Simple");
    password = password.trim();
    char pin[] = password.toCharArray();
    ks = KeyStore.getInstance("pkcs11");
    ks.load(null,pin);
    java.security.cert.Certificate cert = ks.getCertificate(myAlias);
    Key key = ks.getKey(myAlias, pin);
    if(PrivateKey.class.isInstance(key)) {
    privKey = (PrivateKey)key;
    pubKey = cert.getPublicKey();
    FileInputStream in = new FileInputStream("C:\\ReportDBBE.properties");
    FileOutputStream out = new FileOutputStream("C:\\ReportDBAE.properties");
    Cipher cp=Cipher.getInstance("RSA/ECB/PKCS1Padding", p);
    cp.init(cp.ENCRYPT_MODE,pubKey);
    CipherOutputStream cout=new CipherOutputStream(out,cp);
    byte[] input=new byte[8];
    int byteread=in.read(input);
    while(byteread!=-1){
    cout.write(input,0,byteread);
    byteread=in.read(input);
    cout.flush();
    in.close();
    cout.close();
    catch(NoSuchAlgorithmException nsae)
    System.out.println("No Such Algorithm Exception " + nsae.getMessage());
    catch(NoSuchPaddingException nspe)
    System.out.println("No Such Padding Exception " + nspe.getMessage());
    catch(InvalidKeyException ike)
    System.out.println("Invalid Key Exception " + ike.getMessage());
    ike.printStackTrace();
    catch(IllegalStateException ise)
    System.out.println("Illegal State Exception " + ise.getMessage());
    catch(KeyStoreException kse)
    System.out.println("Key Store Exception " + kse.getMessage());
    catch(CertificateException ce)
    System.out.println("Certificate Exception " + ce.getMessage());
    catch(IOException ioe)
    System.out.println("IO Exception " + ioe.getMessage());
    catch(UnrecoverableKeyException unrke)
    System.out.println("Unrecoverable Key Exception " + unrke.getMessage());
    public static void main (String args[]) throws Exception {
    try{
    Encrypt tl = new Encrypt();
    tl.loginToken();
    }catch(Exception e){
    e.printStackTrace();
    Your help is very much appreciated!!!!

    Hi All,
    Now i managed to get alias name.
              char pin[] = password.toCharArray();
              ks = KeyStore.getInstance("pkcs11");
              ks.load(null,pin);
    Enumeration ea = ks.aliases();
              while(ea.hasMoreElements()) {
              myAlias = (String)ea.nextElement();
              }

  • How to change the "name of column" property of an text item in runtime?

    How to change the "name of column" property of an text item in runtime?
    I look the properties of items in help and found nothing about this!
    It's possible?

    Hi,
    an other solution is change the block property QUERY_DATA_SOURCE_TYPE from "Table" to "Sub-query" , than change at run time the property QUERY_DATA_SOURCE_NAME.
    First create block and add items
    The QUERY_DATA_SOURCE_NAME will be for ex. "Select 'A' as col1, 'B' AS col2, 'C' as col3 from dual"
    Set into items the column name property to col1 , col2 ...
    At run time change the query to "Select 'Z' as col1, 'X' as col2 , 'Y' as col3 from dual"
    in this way you can change the source of column value.
    Caution because if you change value type from varchar2 to date you must cast date into varchar2.
    May be that this way is valid only for view data not for insert-update, i don't remember.
    bye
    Message was edited by:
    Killernero

  • KSLD how to specify kernel name when run ksld command on host

    I am trying to use KSLD v1.0 and I could not reproduce similar result shown on KSLD User Guide. I followed almost everything on KSLD User Guide except I don't know how to specify kernel name when running ksld command. Here is what I have tried.
    #ksld -t debug /ksld-space/slo8/proto/root_sparc/platform/sun4u/kernel/sparcv9/unix 99
    I can only get unix and krtld read in. (ksld_dbx)modules could not show any modules *.o
    When I use this
    #ksld -t debug /ksld-space/slo8/proto/root_sparc/platform/sun4u/kernel/sparcv9/genunix 99
    then I can only read on genunix.
    Example on KSLD User Guide use unix.281, what is unix.281 created or obtained from target.
    I noticed some SUN Tachnical Support Guru are online to answer questions, thank you for your quick reply.

    I am having the same problem, did you get a solution?
    Thanks,
    I am trying to use KSLD v1.0 and I could not reproduce
    similar result shown on KSLD User Guide. I followed
    almost everything on KSLD User Guide except I don't
    know how to specify kernel name when running ksld
    command. Here is what I have tried.
    #ksld -t debug
    /ksld-space/slo8/proto/root_sparc/platform/sun4u/kernel
    sparcv9/unix 99
    I can only get unix and krtld read in.
    (ksld_dbx)modules could not show any modules *.o
    When I use this
    #ksld -t debug
    /ksld-space/slo8/proto/root_sparc/platform/sun4u/kernel
    sparcv9/genunix 99
    then I can only read on genunix.
    Example on KSLD User Guide use unix.281, what is
    unix.281 created or obtained from target.
    I noticed some SUN Tachnical Support Guru are online
    to answer questions, thank you for your quick reply.

  • How to specify class name in environment or system property

    Hi,
    Iam learning ejb. I was practicing the stateless session bean. I wrote a sample hello world application. While executing the client am getting the following error.
    {color:#ff0000}Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at hw.HelloClient.main(HelloClient.java:20){color}
    My Client program:
    {color:#3366ff}package hw;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.*;
    import java.util.*;
    public class HelloClient {
    public static void main(String[] args)throws Exception {
    Properties prop = System.getProperties();
    Context ctx= new InitialContext(prop); {color:#800000}// {color}{color:#800000}(Line no :20) here only error is pointing{color}
    Object obj = ctx.lookup("HelloHome");
    HelloHome home = (HelloHome)javax.rmi.PortableRemoteObject.narrow(obj,HelloHome.class);
    Hello hello = home.create();
    System.out.println(hello.hello());
    hello.remove();
    }{color}
    please suggest me a solution.
    note: iam using eclipse ganymede and jboss app server
    Edited by: Arun_ece on Mar 10, 2009 1:13 AM

    Hi,
    You need to create a ejb-jar.xml and jboss.xml files to deploy the application on the servers.
    Also, put these lines of codes after getting System Properties.
    prop.put(Context.PROVIDER_URL, "iiop://localhost:[port_no]");Thanks,
    Srikant

  • How to specify alias for local filesystem in JBOSS

    hi,
    I want to specify alias for localfilesystem in JBOSS. I know how to do it in Apache_2.0.52-Openssl_0.9.7e-Win32. In this we can specify alias as,
    Alias /icons/ "C:/Program Files/Apache_2.0.52-Openssl_0.9.7e-Win32/icons/" in httpd.conf and futher we can specify the directory access also. So I want to do the same thing in JBOSS. How to do it.
    Thanks.

    JBoss is an app-server, not an HTTP server. The concept of directories is meaningless, as everything is based on contexts. Any of the HTTP server options will be handled by the Tomcat (Catalina) engine that is part of the JBoss installation. You can configure the Tomcat server by editing the jboss-service.xml file in JBOSS_HOME/deploy/tomcat-5.5.sar (or something like that). If you really need to start mapping/rewriting URLs onto your J2EE application, I'd suggest using Apache as the front-end, and connect the Web-tier to Apache via mod_jk. Then you can use all of Apache's URL rewriting and directory aliasing and specify access on a per-location basis. Some of Apache's functionality may be available to the Catalina engine, but there's no sense in trying to make Tomcat as "capable" as Apache, when a means to connect the two already exists.
    Brian

  • How to use alias name in where clause

    Hello,
    DECODE (item.inv_type,'OT', (DECODE (item.attribute2, 'STONE', 0, xfer.release_quantity1 * xfer.attribute10)
    'FG', (xfer.release_quantity1 * xfer.attribute10)
    ) matl_val
    In the above code matl_val is alias name i need to use that one in where clause as
    where matl_val > 0
    is this possible or anyother way can anyone help me.

    But the point is as you haven't read the documentation you may miss some valuable points about alias and will soon end with another problem.
    >
    Specify an alias for the column expression. Oracle Database will use this alias in the column heading of the result set. The AS keyword is optional. The alias effectively renames the select list item for the duration of the query. The alias can be used in the order_by_clause but not other clauses in the query.
    >
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/statements_10002.htm#SQLRF01702

  • How does JVM set file.encoding system property?

    The system property file.encoding is changed mysteriously, and we don't have a command line -D option. How does JRockit JVM get the default value for system properties such as file.encoding?
    I am running Jrockit 1.4.2_12.
    Thanks.

    I am running WLS 8.1SP6 on Linux using Jrockit 1.4.2-12. Over the weekend, I bounced WL server, and file.encoding was changed. It used to be ISO-8859-1. Now it is ANSI_X3.4-1968. Neither System Administrator nor WebLogic (farm) Administrator changed anything. Although I can force it with -D, I'd like to figure out what happened.
    Thanks.

  • How to specify realm name when calling weak( ) method on ServletAuthentication class?

    I've created a bunch of custom realms and for a specific user logon (form based "uname" and "pword"), the system knows exactly which custom realm to look up against. However, in using ServletAuthentication class, one can only specify realm name in strong(req, res, realmName), not the weak() method. Any clue?
    -john

    Hi John,
    Did you find the answer to this question? I'm having a similar problem when calling the ServletAuthentication.assertIdentity() method.
    Cheers,
    Vidar

  • How to specify file name while invoking the GET_ZIP_BUNDLE service

    Hello.
    The GET_ZIP_BUNDLE service by default generate zip file with name "Bundle". I wanted to change this name runtime, that is while invoking this service. How can I do it?
    The class ziprenditions.ZipRenditionsHandler most probably handle this service by the method createRenditionBundle.
    There I saw a line:
    downloadName = LocaleResources.getString("csZipRenditionBundleName", this.m_service);I have tried to print the value of csZipRenditionBundleName and I got "Bundle". I am wondering is there any way to set a value to this message key?
    I have tried this idoc function:
    <$createRenditionBundle='some_name'$>before invoking the service. But this didn't work.
    Also I have tried to change it from Java class, and for that I have defined a custom service and did:
    LocaleUtils.encodeMessage("csZipRenditionBundleName", null, "JYM");But this also not working.
    What I want is to get the zip file with the name which is the same to the files it is archiving.
    For more information, here is how I am invoking the GET_ZIP_BUNDLE service:
    I have defined a form element:
    <form action="/cs/idcplg" method="POST" id="zipBundleForm" name="zipBundleForm">
       <input type="hidden" value="GET_ZIP_BUNDLE" name="IdcService">
       <input type="hidden" value="pkg:dDocName,pkg:dID,pkg:Rendition,pkg:RevisionSelectionMethod,pkg:AuxRenditionType" name="bundleKeys">                            
    </form>And I have a button with id downloadContent and I have attached the following JavaScript with it:
    $('#downloadContent').click(function (event){
       event.preventDefault();
       var formId = "zipBundleForm";
       var counter = 0;
       var renditionType = "";
       $("#zipBundleForm").find(":hidden").each(function() {
          if($(this).attr("name").startsWith("pkg:"))
             $(this).remove();     
       $("#downloadContentForm").find('input:checkbox:checked').each(function() {
          renditionType = $(this).val();
          $(".thumbnails").find('input:checkbox:checked').each(function() {
             if($(this).attr('data-type') == 'image'){
                createHiddenInputElement(formId, "pkg:dDocName" + counter, $(this).attr("name"));
                createHiddenInputElement(formId, "pkg:dID" + counter, $(this).attr("id"));
                createHiddenInputElement(formId, "pkg:Rendition" + counter, renditionType)
                createHiddenInputElement(formId, "pkg:RevisionSelectionMethod" + counter, "Specific");                                             
                counter++;     
       $("#zipBundleForm").submit();     
    var createHiddenInputElement = function(formId, elementName, elementValue){
       var newElement = document.createElement("input");
       newElement.setAttribute("type", "hidden");
       newElement.setAttribute("name", elementName);
       newElement.setAttribute("value", elementValue);
       $("#"+formId).append(newElement);
    }Thanks in advance.

    if you want a fixed bundle name other than "bundle", you can override the localization string entry 'csZipRenditionBundleName' in a component.

  • How to use Alias name in OData service in SAP HANA

    Hi,
         I need to change one column name with alias of another name in odata service definition or odata url running in rest client. I am trying to give alias name with as key in the service definition like sql query.
    ex:
    There is one table with column name of PRODUCT_ID. I exporting that table via odata service to SAP UI. In the UI i dont want the product id column as PRODUCT_ID. It should be ike "Prodcut". Like we are using in SQL example
    select "PRODUCT_ID" as "Product" from "producttab";
    But i can't use as key for alias name. So i am getting syntax error.
    I have tried in rest client also ie executing odata file in rest based service. But i got error only.
    If anyone knows about this alias name in odata service, Please help me to resolve this issue..

    Hi Thomas
         Thanks for your reply.
         Actually in odata service definition i am using attribute and calculation views only. But in some case from the model view itself i need to use some alias names to the UI through odata service.
         For example in attribute view i have some columns with name col1,col2... I am getting those columns in UI using  odata service, for particular col2 column i need to change column name as product. And i am using the same view as source of another odata service in that service i need to change that column name as productname.
         In that case i need alias name usage. So that only i am searching alias keyword in odata service.
         Is there any possibility to use alias names in odata service.

  • How to change application name in system-jazn-data.xml

    I have weblogic server installed and applications deployed.
    However, I'd like to change the application name in system-jazn-data.xml, specifically, the "<name>context=APPLICATION,name=app1</name>" change "app1" to be "AllMyApp".
    Is this possible? ideally, I do not want to re-deploy the application. I'm not sure what files in application(I have both Web and EJB based applications) kept the name to point to above names in system-jazn-data.xml
    Thanks

    Hi thanks for your quick response.
    I mean to say we have deployed one application and that application appears as a web-DynPro application in PCD. Then i copied that application and pasted in the application folder as a page(PCD object). The page in the folder and application in webdynpro application both are having the same name.
    Now when i changed the name of the application in webDynPro (By re factoring) and deployed. The name in PCD in webdynPro application get changed but the PCD object in Folder becomes like a warning sign and shows that broken delta link.
    Now i want to know can i edit the link of the object so that it can point to the exect application or i have to copy the application and again paste as PCD object in the folder and then assign again to all 20 roles.
    Thanks & Regards
    Jeetendra....

  • How to give alias name for group of columns.

    the below is the query to get Columns. But, i need to make single alias name to all the column which i get. I need to get column names also event, domain, entity, bpdid. Above columns should be under single alias name like 'baseMessage'. Please advise on this.
    select (select decode(ICKD_CHR_KY1_ID,'I','New','D','Cancelled','U','Modified') from ICKD where ICKD_APLN_ID = 'CSTCOM' and ICKD_NUM_KY1_ID = 1438227010) event, 'Client' domain, 'CustomerCommunication' entity, 'General' scope, (select ICKD_NUM_KY6_ID from ICKD where ICKD_NUM_KY1_ID = 1438227010 and ICKD_APLN_ID = 'CSTCOM') bpdId from dual;

    ; WITH CTE AS (
        SELECT Case When  sum(b.targetTotal) > 0 then  Sum(b.targetTotal)  
                          else 0
               end as Profttarget,
               Case When  sum(a.salestotal) > 0 then  Sum(a.salestotal)  
                          else 0
               end as Sales,
               Case When  sum(a.salescost) > 0 then  Sum(a.salescost)  
                    else 0
               end as SalesCost
        From  Sales A
        JOIN  Target B A.salesdate = B.salesdate
    SELECT Profttarget- ( Sales - SalesCost ) as TargetRequired
    FROM   CTE
    This gives you a query that runs in SQL Server.
    But it does not look right to me. I don't know what the keys of these tables are, but is it really salesdate in both? And even if it is, the join still looks strange.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How can I get the the system property line.separator??

    hi all,
    the system property line.separator .
    the PrintStream's function println uses this properly for next line.. I dont want to use this function. and '\n' does not work exaclty as "the system property line.separator" works..

    System.getProperty("line.separator") oughta do it :-)

  • How to save CSV file in application server while making infospoke

    How to save CSV file in application server to be used as destination while making infospoke.
    Please give the steps.........

    Hi
    If you want to load your flatfile from Application server,then you need to trasfer your file from your desktop(Computer) to Application server by using FTP.
    Try using ARCHIVFILE_CLIENT_TO_SERVER Function module.
    You Just need to give thesource path and the target path
    goto SE37 t-code , which is Function module screen, give the function name ARCHIVFILE_CLIENT_TO_SERVER, on click F8 Execute button.
    for path variable give the file path where it resides like C:\users\xxx\desktop\test.csv
    for target path give the directory path on Application server: /data/bi_data
    remember the directory in Server starts with /.
    U have to where to place the file.
    Otherwise use 3rd party tools to connect to ur appl server like : Core FTP and Absolute FTP in google.
    Otherwise...
    Goto the T.code AL11. From there, you can find the directories available in the Application Server.
    For example, if you wanna save the file in the directory "DIR_HOME", then you can find the path of the directories in the nearby column. With the help of this, you can specify the target path. Specify the target path with directory name followed by the filename with .CSV extension.
    Hope this helps
    regards
    gaurav

Maybe you are looking for

  • VSphere Client SSL error build 10041

    So I'm seeing an odd error after upgrading to build 10041 (from 9926). The vSphere client (both 5.1 and 5.5) will no longer connect to my vCenter instance. I receive the following error "vSphere Client could not connect to "<server>" An unknown conne

  • Passing column name inside an update query

    Hi, To checking if there any number field present in 'ID' column, I am using the follwing query. UPDATE table1 SET COL1 = 'Y' WHERE 0 = ( SELECT CASE WHEN ID IS NULL THEN 1 WHEN REGEXP_LIKE( ID, '^( *)(\+|-)?((\d*[' || SUBSTR(VALUE,1,1) || ']?\d+)|(\

  • Extracting the date of Monday given a date of the same week.

    Hi, I have a instance of Calendar which is set to say day = 25 month = 7 year = 2006 Now the day comes to be Friday. I need to extract the date of the immediate previous Monday, which in this case is the 21st. Is there some way to do that combing giv

  • How do I transfer an iMovie to a dvd if my macbook pro does not have idvd?

    How do I transfer an IMovie to a DVD if my macbook pro does not have IDVD?

  • Enabling scroll down bar in PDF reader

    Hi, Does anyone have any idea how to get the scroll down bar in text field in PDF Reader? I am unable to read the full text in the field without the scroll down bar. Normally this should be a default feature? Some background I have a few text fields