Examples of SecurityContextTokenImpl


Examples of com.sun.xml.wss.core.SecurityContextTokenImpl

            if (token instanceof IssuedTokenContext) {
                Object securityToken = ((IssuedTokenContext)token).getSecurityToken();
                if (securityToken instanceof SecurityContextToken) {
                    SecurityContextToken ret = (SecurityContextToken)securityToken;
                    if (sctId.equals(ret.getIdentifier().toString())) {
                        return new SecurityContextTokenImpl(
                                context.getSOAPMessage().getSOAPPart(), ret.getIdentifier().toString(), ret.getInstance(), ret.getWsuId(), ret.getExtElements());
                    }
                }
            }
        }
View Full Code Here

Examples of com.sun.xml.wss.core.SecurityContextTokenImpl

        //String sctPolicyId = sctBinding.getPolicyToken().getTokenId();
        String sctPolicyId = sctBinding.getUUID();
       
        //Look for SCT in TokenCache
        HashMap tokCache = context.getTokenCache();
        SecurityContextTokenImpl sct = null;
        sct = (SecurityContextTokenImpl)tokCache.get(sctPolicyId);
        boolean tokenInserted = false;
        SOAPElement sctElement = null;
       
        IssuedTokenContext ictx = context.getSecureConversationContext();
       
        if (sct == null) {
            SecurityContextToken sct1 =(SecurityContextToken)ictx.getSecurityToken();
            if (sct1 == null) {
                logger.log(Level.SEVERE, LogStringsMessages.WSS_1347_NULL_SECURE_CONVERSATION_TOKEN());
                throw new XWSSecurityException("SecureConversation Token not Found");
            }
           
            sct = new SecurityContextTokenImpl(
                    secureMessage.getSOAPPart(), sct1.getIdentifier().toString(), sct1.getInstance(), sct1.getWsuId(), sct1.getExtElements());
            // put back in token cache
            tokCache.put(sctPolicyId, sct);
        } else {
            tokenInserted = true;
            // record the element
            sctElement = secureMessage.getElementByWsuId(sct.getWsuId());
        }
       
        String sctWsuId = sct.getWsuId();
        if (sctWsuId == null) {
            sct.setId(secureMessage.generateId());
        }
        sctWsuId = sct.getWsuId();
        String iTokenType = sctBinding.getIncludeToken();
        if(sctBinding.INCLUDE_ALWAYS_TO_RECIPIENT.equals(iTokenType) ||
           sctBinding.INCLUDE_ALWAYS.equals(iTokenType) ||
           sctBinding.INCLUDE_ALWAYS_TO_RECIPIENT_VER2.equals(iTokenType) ||
           sctBinding.INCLUDE_ALWAYS_VER2.equals(iTokenType)) {
           
            if (!tokenInserted) {
                secureMessage.findOrCreateSecurityHeader().insertHeaderBlock(sct);
                // record the element
                sctElement = secureMessage.getElementByWsuId(sct.getWsuId());
            }
           
            DirectReference reference = new DirectReference();
           
            reference.setURI("#" + sctWsuId);
            secTokenRef.setReference(reference);
        } else {
            // we have to insert SCT Session Id instead of wsuId
            DirectReference reference = new DirectReference();
            reference.setSCTURI(sct.getIdentifier().toString(), sct.getInstance());
            secTokenRef.setReference(reference);
        }
       
        return sctElement;
    }
View Full Code Here

Examples of com.sun.xml.wss.core.SecurityContextTokenImpl

                if(MessageConstants.WSSE_BINARY_SECURITY_TOKEN_LNAME.equals(tokenNode.getLocalName())){
                    token = new X509SecurityToken((SOAPElement)tokenNode);
                } else if ( MessageConstants.ENCRYPTEDKEY_LNAME.equals(tokenNode.getLocalName())) {
                    token = new EncryptedKeyToken((SOAPElement)tokenNode);
                } else if (MessageConstants.SECURITY_CONTEXT_TOKEN_LNAME.equals(tokenNode.getLocalName())) {
                    token = new SecurityContextTokenImpl((SOAPElement)tokenNode);
                } else if (MessageConstants.DERIVEDKEY_TOKEN_LNAME.equals(tokenNode.getLocalName())){
                    token = new DerivedKeyTokenHeaderBlock((SOAPElement)tokenNode);
                }
            }
            cache.put(uri, token);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.