/** * Get the Request object which identifies the secret key to be returned. * * @return the Request object which identifies the private key * to be returned, or null. If null, the handler of the callback * relies on its own deafult. */ public Request getRequest() { return (Request)super.getRequest(); } }
String alias = ((SecretKeyCallback.AliasRequest)secretKeyCallback.getRequest()).getAlias(); if (alias != null) { try { secretKeyCallback.setKey( passwordAdapter.getPasswordSecretKeyForAlias(alias)); } catch(Exception e) { " Error reading key ! for alias "+alias, e); secretKeyCallback.setKey(null); secretKeyCallback.setKey(null); if (_logger.isLoggable(Level.WARNING)) { _logger.log(Level.WARNING, "jmac.unsupportreadprinciple");
public SecretKey getSecretKey(Map context, String alias, boolean encryptMode) throws XWSSecurityException { /* Use SecretKeyCallback */ SecretKeyCallback.Request request = new SecretKeyCallback.AliasRequest(alias); SecretKeyCallback skCallback = new SecretKeyCallback(request); Callback[] callbacks = new Callback[] { skCallback }; try { _handler.handle(callbacks); } catch (Exception e) { log.log(Level.SEVERE, "WSS0216.callbackhandler.handle.exception", new Object[] { "SecretKeyCallback.AliasRequest"}); throw new XWSSecurityException(e); } return (SecretKey) skCallback.getKey(); }
String alias = ((SecretKeyCallback.AliasRequest)secretKeyCallback.getRequest()).getAlias(); if (alias != null) { try { secretKeyCallback.setKey( passwordAdapter.getPasswordSecretKeyForAlias(alias)); } catch(Exception e) { " Error reading key ! for alias "+alias, e); secretKeyCallback.setKey(null); secretKeyCallback.setKey(null); if (_logger.isLoggable(Level.WARNING)) { _logger.log(Level.WARNING, "jmac.unsupportreadprinciple");
SecretKeyCallback.AliasRequest ar = new SecretKeyCallback.AliasRequest(alias); SecretKeyCallback skcb = new SecretKeyCallback(ar); Callback[] callbacks = new Callback[] {skcb}; try { this._handler.handle(callbacks); javax.crypto.SecretKey key = skcb.getKey(); byte[] password = key.getEncoded(); return new String(password);
/** * Get the Request object which identifies the secret key to be returned. * * @return the Request object which identifies the private key * to be returned, or null. If null, the handler of the callback * relies on its own deafult. */ public Request getRequest() { return (Request)super.getRequest(); } }