private REFERENCE_TYPE getReferenceType(SecurityTokenReference secRef) { if (secRef.containsReference()) { return REFERENCE_TYPE.DIRECT_REF; } else if (secRef.containsKeyIdentifier()) { if (SecurityTokenReference.THUMB_URI.equals(secRef.getKeyIdentifierValueType())) { return REFERENCE_TYPE.THUMBPRINT_SHA1; } else { return REFERENCE_TYPE.KEY_IDENTIFIER; } } return null; } }
private REFERENCE_TYPE getReferenceType(SecurityTokenReference secRef) { if (secRef.containsReference()) { return REFERENCE_TYPE.DIRECT_REF; } else if (secRef.containsKeyIdentifier()) { if (SecurityTokenReference.THUMB_URI.equals(secRef.getKeyIdentifierValueType())) { return REFERENCE_TYPE.THUMBPRINT_SHA1; } else { return REFERENCE_TYPE.KEY_IDENTIFIER; } } return null; }
/** * Check that the EncryptedKey referenced by the SecurityTokenReference argument * is BSP compliant. * @param secRef The SecurityTokenReference to the BinarySecurityToken * @param bspEnforcer a BSPEnforcer instance to enforce BSP rules * @throws WSSecurityException */ public static void checkEncryptedKeyBSPCompliance( SecurityTokenReference secRef, BSPEnforcer bspEnforcer ) throws WSSecurityException { if (secRef.containsKeyIdentifier()) { String valueType = secRef.getKeyIdentifierValueType(); if (!SecurityTokenReference.ENC_KEY_SHA1_URI.equals(valueType)) { bspEnforcer.handleBSPRule(BSPRule.R3063); } } String tokenType = secRef.getTokenType(); if (!WSConstants.WSS_ENC_KEY_VALUE_TYPE.equals(tokenType)) { bspEnforcer.handleBSPRule(BSPRule.R5215); } }
&& WSS4JConstants.WSSE_NS.equals(child.getNamespaceURI())) { String valueType = getKeyIdentifierValueType();
String valueType = secRef.getKeyIdentifierValueType(); if (!SecurityTokenReference.SKI_URI.equals(valueType) && !SecurityTokenReference.THUMB_URI.equals(valueType)
result = 31 * result + keyIdentifierEncodingType.hashCode(); String keyIdentifierValueType = getKeyIdentifierValueType(); if (keyIdentifierValueType != null) { result = 31 * result + keyIdentifierValueType.hashCode();
if (WSConstants.WSS_SAML_KI_VALUE_TYPE.equals(secRef.getKeyIdentifierValueType()) || WSConstants.WSS_SAML2_KI_VALUE_TYPE.equals(secRef.getKeyIdentifierValueType())) { return STRParserUtil.getTokenElement(doc, wsDocInfo, null, secRef.getKeyIdentifierValue(), secRef.getKeyIdentifierValueType()); } else { X509Certificate[] certs = secRef.getKeyIdentifier(wsDocInfo.getCrypto());
) throws WSSecurityException { String keyIdentifierValue = secRef.getKeyIdentifierValue(); String type = secRef.getKeyIdentifierValueType(); WSSecurityEngineResult result = request.getWsDocInfo().getResult(keyIdentifierValue);
String valueType = secRef.getKeyIdentifierValueType(); if (samlAssertion.getSaml1() != null && !WSConstants.WSS_SAML_KI_VALUE_TYPE.equals(valueType)) {
String valueType = secRef.getKeyIdentifierValueType(); if (WSConstants.WSS_SAML_KI_VALUE_TYPE.equals(valueType) || WSConstants.WSS_SAML2_KI_VALUE_TYPE.equals(valueType)) { secRef.getKeyIdentifierValue(), secRef.getKeyIdentifierValueType(), WSPasswordCallback.SECRET_KEY, data );
return false; if (!compare(getKeyIdentifierValueType(), tokenReference.getKeyIdentifierValueType())) { return false;
if (secRef.getKeyIdentifierValueType().equals(SecurityTokenReference.ENC_KEY_SHA1_URI)) { STRParserUtil.checkEncryptedKeyBSPCompliance(secRef, data.getBSPEnforcer()); WSPasswordCallback.SECRET_KEY, data)); parserResult.setPrincipal(new CustomTokenPrincipal(id)); } else if (WSConstants.WSS_SAML_KI_VALUE_TYPE.equals(secRef.getKeyIdentifierValueType()) || WSConstants.WSS_SAML2_KI_VALUE_TYPE.equals(secRef.getKeyIdentifierValueType())) { parseSAMLKeyIdentifier(secRef, data, parserResult); } else {
if (WSConstants.WSS_SAML_KI_VALUE_TYPE.equals(secRef.getKeyIdentifierValueType()) || WSConstants.WSS_SAML2_KI_VALUE_TYPE.equals(secRef.getKeyIdentifierValueType())) { SamlAssertionWrapper samlAssertion = STRParserUtil.getAssertionFromKeyIdentifier(
STRParserUtil.checkBinarySecurityBSPCompliance(secRef, null, data.getBSPEnforcer()); String valueType = secRef.getKeyIdentifierValueType(); if (WSConstants.WSS_KRB_KI_VALUE_TYPE.equals(valueType)) { byte[] secretKey =
SecurityTokenReference secRef = tempSig.getSecurityTokenReference(); if (WSS4JConstants.WSS_SAML_KI_VALUE_TYPE.equals(secRef.getKeyIdentifierValueType()) || WSS4JConstants.WSS_SAML2_KI_VALUE_TYPE.equals(secRef.getKeyIdentifierValueType())) {
SecurityTokenReference secRef = tempSig.getSecurityTokenReference(); if (WSS4JConstants.WSS_SAML_KI_VALUE_TYPE.equals(secRef.getKeyIdentifierValueType()) || WSS4JConstants.WSS_SAML2_KI_VALUE_TYPE.equals(secRef.getKeyIdentifierValueType())) {
String keyIdentifierValueType = secRef.getKeyIdentifierValueType(); if (WSConstants.WSS_KRB_KI_VALUE_TYPE.equals(keyIdentifierValueType)) { byte[] secretKey =
STRParserResult parserResult ) throws WSSecurityException { String valueType = secRef.getKeyIdentifierValueType(); byte[] secretKey = STRParserUtil.getSecretKeyFromToken(secRef.getKeyIdentifierValue(), valueType, WSPasswordCallback.SECRET_KEY, data);