/** * Create a KeyInfo object * @throws ConversationException */ private KeyInfo createKeyInfo() throws WSSecurityException, ConversationException { KeyInfo keyInfo = new KeyInfo(document); SecurityTokenReference secToken = new SecurityTokenReference(document); secToken.addWSSENamespace(); Reference ref = new Reference(document); ref.setURI("#" + dktId); String ns = ConversationConstants.getWSCNs(getWscVersion()) + ConversationConstants.TOKEN_TYPE_DERIVED_KEY_TOKEN; ref.setValueType(ns); secToken.setReference(ref); keyInfo.addUnknownElement(secToken.getElement()); Element keyInfoElement = keyInfo.getElement(); keyInfoElement.setAttributeNS( WSConstants.XMLNS_NS, "xmlns:" + WSConstants.SIG_PREFIX, WSConstants.SIG_NS ); return keyInfo; }
} else if (keyIdentifierType == WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER) { SecurityTokenReference secToken = new SecurityTokenReference(document); secToken.addWSSENamespace(); if (customReferenceValue != null) { secToken.setKeyIdentifierEncKeySHA1(customReferenceValue); } else if (WSConstants.WSS_SAML_KI_VALUE_TYPE.equals(customReferenceValue)) { SecurityTokenReference secToken = new SecurityTokenReference(document); secToken.addWSSENamespace(); secToken.addTokenType(WSConstants.WSS_SAML_TOKEN_TYPE); secToken.setKeyIdentifier(WSConstants.WSS_SAML_KI_VALUE_TYPE, encKeyId); } else if (WSConstants.WSS_SAML2_KI_VALUE_TYPE.equals(customReferenceValue)) { SecurityTokenReference secToken = new SecurityTokenReference(document); secToken.addWSSENamespace(); secToken.addTokenType(WSConstants.WSS_SAML2_TOKEN_TYPE); secToken.setKeyIdentifier(WSConstants.WSS_SAML2_KI_VALUE_TYPE, encKeyId); } else if (WSConstants.WSS_KRB_KI_VALUE_TYPE.equals(customReferenceValue)) { SecurityTokenReference secToken = new SecurityTokenReference(document); secToken.addWSSENamespace(); secToken.addTokenType(WSConstants.WSS_GSS_KRB_V5_AP_REQ); secToken.setKeyIdentifier(customReferenceValue, encKeyId, true); } else if (encKeyId != null) { SecurityTokenReference secToken = new SecurityTokenReference(document); secToken.addWSSENamespace(); Reference ref = new Reference(document); if (encKeyIdDirectId) {
} else if (keyIdentifierType == WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER) { SecurityTokenReference secToken = new SecurityTokenReference(document); secToken.addWSSENamespace(); if (customReferenceValue != null) { secToken.setKeyIdentifierEncKeySHA1(customReferenceValue); } else if (WSConstants.WSS_SAML_KI_VALUE_TYPE.equals(customReferenceValue)) { SecurityTokenReference secToken = new SecurityTokenReference(document); secToken.addWSSENamespace(); secToken.addTokenType(WSConstants.WSS_SAML_TOKEN_TYPE); secToken.setKeyIdentifier(WSConstants.WSS_SAML_KI_VALUE_TYPE, encKeyId); } else if (WSConstants.WSS_SAML2_KI_VALUE_TYPE.equals(customReferenceValue)) { SecurityTokenReference secToken = new SecurityTokenReference(document); secToken.addWSSENamespace(); secToken.addTokenType(WSConstants.WSS_SAML2_TOKEN_TYPE); secToken.setKeyIdentifier(WSConstants.WSS_SAML2_KI_VALUE_TYPE, encKeyId); } else if (WSConstants.WSS_KRB_KI_VALUE_TYPE.equals(customReferenceValue)) { SecurityTokenReference secToken = new SecurityTokenReference(document); secToken.addWSSENamespace(); secToken.addTokenType(WSConstants.WSS_GSS_KRB_V5_AP_REQ); secToken.setKeyIdentifier(customReferenceValue, encKeyId, true); } else if (encKeyId != null) { SecurityTokenReference secToken = new SecurityTokenReference(document); secToken.addWSSENamespace(); Reference ref = new Reference(document); if (encKeyIdDirectId) {
/** * Create a KeyInfo object * @throws ConversationException */ private KeyInfo createKeyInfo() throws WSSecurityException, ConversationException { KeyInfo keyInfo = new KeyInfo(document); SecurityTokenReference secToken = new SecurityTokenReference(document); secToken.addWSSENamespace(); Reference ref = new Reference(document); ref.setURI("#" + dktId); String ns = ConversationConstants.getWSCNs(getWscVersion()) + ConversationConstants.TOKEN_TYPE_DERIVED_KEY_TOKEN; ref.setValueType(ns); secToken.setReference(ref); keyInfo.addUnknownElement(secToken.getElement()); Element keyInfoElement = keyInfo.getElement(); keyInfoElement.setAttributeNS( WSConstants.XMLNS_NS, "xmlns:" + WSConstants.SIG_PREFIX, WSConstants.SIG_NS ); return keyInfo; }
secRef = new SecurityTokenReference(doc); strUri = getWsConfig().getIdAllocator().createSecureId("STR-", secRef); secRef.addWSSENamespace(); secRef.addWSUNamespace(); secRef.setID(strUri);
secRef = new SecurityTokenReference(doc); strUri = getWsConfig().getIdAllocator().createSecureId("STR-", secRef); secRef.addWSSENamespace(); secRef.addWSUNamespace(); secRef.setID(strUri);