<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: KeyStore access from Java mapping in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466751#M76288</link>
    <description>&lt;P&gt;Hi Otto, how are you ?&lt;/P&gt;&lt;P&gt;Can you please let me know how you got the library com.sap.aii.af.service.resource.SAPSecurityResources in order to execute the comand below :&lt;/P&gt;&lt;P&gt; managerPriviliged = com.sap.aii.af.service.resource.SAPSecurityResources.getInstance().getKeyStoreManager(
com.sap.aii.security.lib.PermissionMode.SYSTEM_LEVEL)&lt;/P&gt;&lt;P&gt;I have been searching for this library as I want to used this command in my java mapping but I searched everywhere and could not locate it. &lt;/P&gt;&lt;P&gt;Thank you. &lt;/P&gt;</description>
    <pubDate>Thu, 11 Apr 2019 14:18:48 GMT</pubDate>
    <dc:creator>former_member276938</dc:creator>
    <dc:date>2019-04-11T14:18:48Z</dc:date>
    <item>
      <title>KeyStore access from Java mapping</title>
      <link>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaq-p/466743</link>
      <description>&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;I am working on PI 7.3 dual stack. There is a requirement where Java Mapping will have to access the Key Store Manager and get the digital key maintained in the NWA. Please provide me any example code and the relevant jar files.&lt;/P&gt;&lt;P&gt; Thanks and Regards, &lt;/P&gt;&lt;P&gt;Rana Brata De&lt;/P&gt;</description>
      <pubDate>Sun, 23 Apr 2017 22:54:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaq-p/466743</guid>
      <dc:creator>former_member200339</dc:creator>
      <dc:date>2017-04-23T22:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: KeyStore access from Java mapping</title>
      <link>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466744#M76281</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Here you are:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;import java.rmi.RemoteException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.PrivateKey;
import java.security.Security;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import com.sap.engine.interfaces.keystore.KeystoreManager;
import com.sap.security.core.server.ssf.SsfProfileKeyStore;
import com.sap.aii.mapping.api.StreamTransformationException;


private static SsfProfileKeyStore getCertProfile(String alias, String password) throws StreamTransformationException {
	//	get profile from keystore service of AS Java
	InitialContext ctx = null;		
	try {
		ctx = new InitialContext();
	} catch (NamingException ex) {
		throw new StreamTransformationException("Initial context: " + ex.getMessage(), ex);
	}
	
	KeystoreManager manager = null;		
	try {		
	   manager = (KeystoreManager)ctx.lookup("keystore");
	} catch (NamingException ex) {
		throw new StreamTransformationException("Named object: " + ex.getMessage(), ex);
	}
				
	KeyStore keyStore = null;
	try {	
		keyStore = manager.getKeystore("DEFAULT");
	} catch (RemoteException ex) {
		throw new StreamTransformationException("Default keystore: " + ex.getMessage(), ex);
	}
	
	SsfProfileKeyStore profile = null;       
	try {
		profile = new SsfProfileKeyStore(keyStore, alias, password);
	} catch (KeyStoreException ex) {
		throw new StreamTransformationException("Profile: " + ex.getMessage(), ex);
	}			
			
	return profile;				
}

(...)

SsfProfileKeyStore profile = getCertProfile(alias, password);			
PrivateKey key = (PrivateKey)profile.getPrivateKey(); 			
X509Certificate[] chain = profile.getCertificateChain();
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Andrzej&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 07:56:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466744#M76281</guid>
      <dc:creator>Andrzej_Filusz</dc:creator>
      <dc:date>2017-04-24T07:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: KeyStore access from Java mapping</title>
      <link>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466745#M76282</link>
      <description>&lt;P&gt;Dear Andrzej,&lt;/P&gt;&lt;P&gt;Thanks for your reply. I could reach the Key Storage and view some of the keys i.e. &lt;/P&gt;&lt;P&gt;securestorage, TrustedCAs, DEFAULT, WebServiceSecurity, WebServiceSecurity_Certs. We have made a similar one in the name of our company &amp;lt;CompanyName&amp;gt; and imported a certificate in it. But we cannot see that one. Our objective is to find the certificate and as well as the private-key from mapping. Do you have any suggestion on how to proceed.&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Rana Brata De&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 15:13:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466745#M76282</guid>
      <dc:creator>former_member200339</dc:creator>
      <dc:date>2017-04-25T15:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: KeyStore access from Java mapping</title>
      <link>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466746#M76283</link>
      <description>&lt;P&gt;1788571 - Protection domains for PI mapping classes&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 13:54:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466746#M76283</guid>
      <dc:creator>otto_frost4</dc:creator>
      <dc:date>2017-12-20T13:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: KeyStore access from Java mapping</title>
      <link>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466747#M76284</link>
      <description>&lt;P&gt;791649 - User unable to logon by ticket&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 15:13:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466747#M76284</guid>
      <dc:creator>otto_frost4</dc:creator>
      <dc:date>2017-12-20T15:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: KeyStore access from Java mapping</title>
      <link>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466748#M76285</link>
      <description>&lt;P&gt;the tickets didn't solve the problem&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 15:14:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466748#M76285</guid>
      <dc:creator>otto_frost4</dc:creator>
      <dc:date>2017-12-20T15:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: KeyStore access from Java mapping</title>
      <link>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466749#M76286</link>
      <description>&lt;P&gt;&lt;A href="https://help.sap.com/saphelp_nw74/helpdata/en/43/a52f2e63161bbfe10000000a1553f7/frameset.htm" target="test_blank"&gt;https://help.sap.com/saphelp_nw74/helpdata/en/43/a52f2e63161bbfe10000000a1553f7/frameset.htm&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;SAPSecurityResources&lt;/P&gt;
  &lt;P&gt;//https://help.sap.com/doc/javadocs_nw75_sps06/7.5.6/en-US/PI/com/sap/aii/af/service/resource/SAPSecurityResources.html //https://help.sap.com/saphelp_nw74/helpdata/en/43/a52f2e63161bbfe10000000a1553f7/frameset.htm&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 16:39:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466749#M76286</guid>
      <dc:creator>otto_frost4</dc:creator>
      <dc:date>2018-01-05T16:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: KeyStore access from Java mapping</title>
      <link>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466750#M76287</link>
      <description>&lt;P&gt;Finally got it working&lt;/P&gt;
  &lt;P&gt;The mapping class is executing as user Guest. &lt;/P&gt;
  &lt;P&gt;User Guest has no access to keystores and shouldn't have.&lt;/P&gt;
  &lt;P&gt;Therefore it's necessary to use the com.sap.aii.af.service.resource.SAPSecurityResources.getInstance().getKeyStoreManager(com.sap.aii.security.lib.PermissionMode.SYSTEM_LEVEL) API.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;ISsfProfile getSsfProfileKeyStore(String keyStoreAlias, String keyStoreEntry) throws StreamTransformationException {

KeyStoreManager managerPriviliged = null;
try {
managerPriviliged = com.sap.aii.af.service.resource.SAPSecurityResources.getInstance().getKeyStoreManager(
com.sap.aii.security.lib.PermissionMode.SYSTEM_LEVEL);
} catch (KeyStoreException e) {
throw new StreamTransformationException("SAPSecurityResources", e);
}
KeyStore keyStore;
try {
keyStore = managerPriviliged.getKeyStore(keyStoreAlias);
} catch (KeyStoreException e) {
throw new StreamTransformationException("managerPriviliged.getKeyStore " + keyStoreAlias, e);
}
ISsfProfile profile = null;
try {
profile = managerPriviliged.getISsfProfile(keyStore, keyStoreEntry, null);
} catch (KeyStoreException e) {
throw new StreamTransformationException("Failed to load SsfProfileKeyStore " + keyStoreAlias + " " + keyStoreEntry, e);
}
return profile;
}&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jan 2018 17:35:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466750#M76287</guid>
      <dc:creator>otto_frost4</dc:creator>
      <dc:date>2018-01-08T17:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: KeyStore access from Java mapping</title>
      <link>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466751#M76288</link>
      <description>&lt;P&gt;Hi Otto, how are you ?&lt;/P&gt;&lt;P&gt;Can you please let me know how you got the library com.sap.aii.af.service.resource.SAPSecurityResources in order to execute the comand below :&lt;/P&gt;&lt;P&gt; managerPriviliged = com.sap.aii.af.service.resource.SAPSecurityResources.getInstance().getKeyStoreManager(
com.sap.aii.security.lib.PermissionMode.SYSTEM_LEVEL)&lt;/P&gt;&lt;P&gt;I have been searching for this library as I want to used this command in my java mapping but I searched everywhere and could not locate it. &lt;/P&gt;&lt;P&gt;Thank you. &lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 14:18:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466751#M76288</guid>
      <dc:creator>former_member276938</dc:creator>
      <dc:date>2019-04-11T14:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: KeyStore access from Java mapping</title>
      <link>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466752#M76289</link>
      <description>&lt;P&gt;I think I use this tool or a similar on sourceforge&lt;/P&gt;&lt;P&gt;&lt;A href="http://jfind.sourceforge.net/"&gt;http://jfind.sourceforge.net&lt;/A&gt;/ I use jfind&lt;/P&gt;&lt;P&gt;&lt;A href="https://sourceforge.net/projects/jarfinder/"&gt;https://sourceforge.net/projects/jarfinder/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The one I use can be run without gui on unix console as well.&lt;/P&gt;&lt;P&gt;Start searching the NWDS installation.&lt;/P&gt;&lt;P&gt;if not found then search the SAP PO / SAP PI installation on the server.&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/javadocs" target="test_blank"&gt;http://help.sap.com/javadocs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;check the docs&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;/Otto&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 19:35:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466752#M76289</guid>
      <dc:creator>otto_frost4</dc:creator>
      <dc:date>2019-04-11T19:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: KeyStore access from Java mapping</title>
      <link>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466753#M76290</link>
      <description>&lt;P&gt;I usually keep a copy of all the jar files from the server on my pc to easily search the jars.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 19:42:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466753#M76290</guid>
      <dc:creator>otto_frost4</dc:creator>
      <dc:date>2019-04-11T19:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: KeyStore access from Java mapping</title>
      <link>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466754#M76291</link>
      <description>&lt;P&gt;&lt;A href="https://help.sap.com/doc/2f39047ed6b141cb83658041d2d4e029/7.5.14/en-US/PI/com/sap/aii/af/service/resource/SAPSecurityResources.html" target="test_blank"&gt;https://help.sap.com/doc/2f39047ed6b141cb83658041d2d4e029/7.5.14/en-US/PI/com/sap/aii/af/service/resource/SAPSecurityResources.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/2f39047ed6b141cb83658041d2d4e029/7.5.14/en-US/PI/com/sap/aii/af/service/resource/SAPSecurityResources.html" target="_blank"&gt;SAPSecurityResources&lt;/A&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 19:46:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/keystore-access-from-java-mapping/qaa-p/466754#M76291</guid>
      <dc:creator>otto_frost4</dc:creator>
      <dc:date>2019-04-11T19:46:23Z</dc:date>
    </item>
  </channel>
</rss>

