This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 156056

Summary: Code bug, enhancement in Saml20HOKCallbackHandler
Product: webservices Reporter: gmazza <gmazza>
Component: WSITAssignee: Martin Grebac <mgrebac>
Status: NEW ---    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description gmazza 2008-12-25 03:23:30 UTC
Hello, one bug to report and one possible place for optimization:

1.) (bug) The initTrustStore() method in the autogenerated Saml20HOKCallbackHandler class (and very possibly the
others--HOK 1.0 and SV 1.0 and SV 2.0) created when you have a SOAP client using SAML has a bug.  It should be
trustStore = TrustStore.getInstance(...) in the first line of the code below.

Example from Saml20HOKCallbackHandler

    private void initTrustStore() throws IOException {
        try {
            trustStore = KeyStore.getInstance(trustStoreType);  <-- bug
            trustStore.load(new FileInputStream(trustStoreURL), trustStorePassword.toCharArray());
        } catch (Exception e) {
            throw new IOException(e.getMessage());
        }
    }


2. (possible optimization) getDefaultPrivKeyCert() is calling keyStore.getCertificate(...) twice on the certificate it
actually needs (once with currentAlias, once with uniqueAlias)--I wonder if that could be easily optimized to once.
Comment 1 Martin Grebac 2009-01-07 09:44:17 UTC
1) J2SE does not have a separate class called TrustStore. A Java Keystore can be used as a TrustStore. 
2) I'm changing this issue to an enhancement and will try to implement it for 7.0.