on 03-25-2009 2:47 PM
Hi everyone,
i have the following code:
public String getMessage(String name) {
String msg = "";
try {
InitialContext ctx = new InitialContext();
Object o = (Object) ctx.lookup("keystore");
KeystoreManager manager = (KeystoreManager) o;
String[] keyStores = manager.getKeystoreViewAliases();
Enumeration<String> aliases = null;
KeyStore keyStore = null;
String alias = null;
StringBuilder sb = new StringBuilder();
for(int i = 0; i < keyStores.length; i++){
keyStore = manager.getKeystore(keyStores<i>);
aliases = keyStore.aliases();
while(aliases.hasMoreElements()){
alias = aliases.nextElement();
sb.append(keyStores<i> + " : " + alias + "\n");
}
sb.append(keyStores<i> + " : "
+ keyStore.getType() + "\n");
}
msg = "try: " + sb.toString();
}catch(Exception ex){
msg += "catch: " + ex.getMessage();
}
return msg;
}
this is a session bean method, which get all keystores and each alias from each keystore and print a message (later this will have other functionality). But, when i run a client for this method, just some keystores are listed like the "TrustedCAs" and "DEFAULT"...but i'd like to list all keystores. Looking for
answers, i found out that happens because this keystores and its alias are trusted. but how can i grant
which the others are trusted to?
I'm using Netweaver 7.1 and EJB 3.0
Could anybody help me?
Thanks in Advance
Hi cs.santos0,
This is a pretty old thread, just wondering if you have any solution on this? I am facing the similar problem when trying to get the keystoremanager with SAPSecurityResources.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
just look this
http://help.sap.com/saphelp_nwpi71/helpdata/en/e9/a1dd44d2c83c43afb5ec8a4292f3e0/frameset.htm
http://www.java2s.com/Code/Java/Security/CertificateSigner.htm
let me know am i reach ur point
bvr
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi, thanks again....
i saw that sites, in one of them i found something interesting....
"Make sure you access the DEFAULT Keystore so you won't get into trouble with permissions (I suggest you store your certificates in DEFAULT)"
yes...this is exactly the issue, i can access the DEFAULT keystore (and some others), but i think the others are locked. I already granted permission for my EJB on Security Tab...now i guess, that is missing something else on my code...
I have the following code:
SAPSecurityResources secRes = SAPSecurityResources.getInstance();
KeyStoreManager manager = secRes.getKeyStoreManager(PermissionMode.SYSTEM_LEVEL);
KeyStore keyStore = manager.getKeyStore(certView);
ISsfProfile profile = manager.getISsfProfile(keyStore, certEntry, null);
X509Certificate cert = profile.getCertificate();
String sName = cert.getSubjectDN().getName();
cert.checkValidity();
this works almost equal what i need, but for other questions, i can't used...so, i'm wondering that i need something looks like this:
KeyStoreManager manager = secRes.getKeyStoreManager(PermissionMode.SYSTEM_LEVEL);
i mean, something that granted my pemission on my method....
could you help me?
Thanks in Advance
hi,
please check the following
[link|http://help.sap.com/saphelp_nw04/helpdata/en/a4/d0201854fb6a4cb9545892b49d4851/frameset.htm]
[link1|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c6519490-0201-0010-50b4-e824ef87511b]
http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/security/lib/KeyStoreManager.html
let me know am i reached ur point
bvr
Edited by: bvr on Mar 26, 2009 7:41 AM
Edited by: bvr on Mar 26, 2009 8:42 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi, thanks for answer!!
I saw every links that you post...but I've seen almost all of then.
Do you have an idea how can i solve that?...because i already granted the permissions for my keystore view entries on the security tab on SAP NetWeaver Administrator. But i don't know if i need to put something else on my method....
just as an observation my KeyStoreManager is that:
import com.sap.engine.interfaces.keystore.KeystoreManager;
and with this, i can get some certifies as i said, but i don't know how get all....
Could help me please?
Thanks in Advance
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.