result = 31 * result + keyIdentifierValueType.hashCode(); String keyIdentifierValue = getKeyIdentifierValue(); if (keyIdentifierValue != null) { result = 31 * result + keyIdentifierValue.hashCode();
/** * Create a WSDerivedKeyTokenPrincipal from this DerivedKeyToken object */ public Principal createPrincipal() throws WSSecurityException { WSDerivedKeyTokenPrincipal principal = new WSDerivedKeyTokenPrincipal(getID()); principal.setNonce(getNonce()); principal.setLabel(getLabel()); principal.setLength(getLength()); principal.setOffset(getOffset()); principal.setAlgorithm(getAlgorithm()); String basetokenId = null; SecurityTokenReference securityTokenReference = getSecurityTokenReference(); if (securityTokenReference != null && securityTokenReference.getReference() != null) { basetokenId = securityTokenReference.getReference().getURI(); basetokenId = XMLUtils.getIDFromReference(basetokenId); } else if (securityTokenReference != null) { // KeyIdentifier basetokenId = securityTokenReference.getKeyIdentifierValue(); } principal.setBasetokenId(basetokenId); return principal; }
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 {
/** * Parse a SecurityTokenReference element and extract credentials. * * @param parameters The parameters to parse * @return the STRParserResult Object containing the parsing results * @throws WSSecurityException */ public STRParserResult parseSecurityTokenReference(STRParserParameters parameters) throws WSSecurityException { if (parameters == null || parameters.getData() == null || parameters.getData().getWsDocInfo() == null || parameters.getStrElement() == null) { throw new WSSecurityException( WSSecurityException.ErrorCode.FAILURE, "invalidSTRParserParameter" ); } SecurityTokenReference secRef = new SecurityTokenReference(parameters.getStrElement(), parameters.getData().getBSPEnforcer()); String uri = null; if (secRef.getReference() != null) { uri = secRef.getReference().getURI(); uri = XMLUtils.getIDFromReference(uri); } else if (secRef.containsKeyIdentifier()) { uri = secRef.getKeyIdentifierValue(); } WSSecurityEngineResult result = parameters.getData().getWsDocInfo().getResult(uri); if (result != null) { return processPreviousResult(result, secRef, parameters); } return processSTR(secRef, uri, parameters); }
RequestData request ) throws WSSecurityException { String keyIdentifierValue = secRef.getKeyIdentifierValue(); String type = secRef.getKeyIdentifierValueType(); WSSecurityEngineResult result = request.getWsDocInfo().getResult(keyIdentifierValue);
uri = XMLUtils.getIDFromReference(uri); } else if (secRef.containsKeyIdentifier()) { uri = secRef.getKeyIdentifierValue();
return false; if (!compare(getKeyIdentifierValue(), tokenReference.getKeyIdentifierValue())) { return false;
/** * Parse a SecurityTokenReference element and extract credentials. * * @param parameters The parameters to parse * @return the STRParserResult Object containing the parsing results * @throws WSSecurityException */ public STRParserResult parseSecurityTokenReference(STRParserParameters parameters) throws WSSecurityException { if (parameters == null || parameters.getData() == null || parameters.getData().getWsDocInfo() == null || parameters.getStrElement() == null) { throw new WSSecurityException( WSSecurityException.ErrorCode.FAILURE, "invalidSTRParserParameter" ); } SecurityTokenReference secRef = new SecurityTokenReference(parameters.getStrElement(), parameters.getData().getBSPEnforcer()); String uri = null; if (secRef.getReference() != null) { uri = secRef.getReference().getURI(); uri = XMLUtils.getIDFromReference(uri); } else if (secRef.containsKeyIdentifier()) { uri = secRef.getKeyIdentifierValue(); } WSSecurityEngineResult result = parameters.getData().getWsDocInfo().getResult(uri); if (result != null) { return processPreviousResult(result, secRef, parameters); } return processSTR(secRef, parameters); }
|| WSConstants.WSS_SAML2_KI_VALUE_TYPE.equals(valueType)) { byte[] secretKey = STRParserUtil.getSecretKeyFromToken(secRef.getKeyIdentifierValue(), valueType, WSPasswordCallback.SECRET_KEY, data); if (secretKey == null) { } else if (WSConstants.WSS_KRB_KI_VALUE_TYPE.equals(valueType)) { byte[] secretKey = STRParserUtil.getSecretKeyFromToken(secRef.getKeyIdentifierValue(), valueType, WSPasswordCallback.SECRET_KEY, data); if (secretKey == null) { secRef.getKeyIdentifierValue(), secRef.getKeyIdentifierValueType(), WSPasswordCallback.SECRET_KEY, data );
/** * Parse a SecurityTokenReference element and extract credentials. * * @param parameters The parameters to parse * @return the STRParserResult Object containing the parsing results * @throws WSSecurityException */ public STRParserResult parseSecurityTokenReference(STRParserParameters parameters) throws WSSecurityException { if (parameters == null || parameters.getData() == null || parameters.getData().getWsDocInfo() == null || parameters.getStrElement() == null) { throw new WSSecurityException( WSSecurityException.ErrorCode.FAILURE, "invalidSTRParserParameter" ); } SecurityTokenReference secRef = new SecurityTokenReference(parameters.getStrElement(), parameters.getData().getBSPEnforcer()); String uri = null; if (secRef.getReference() != null) { uri = secRef.getReference().getURI(); uri = XMLUtils.getIDFromReference(uri); } else if (secRef.containsKeyIdentifier()) { uri = secRef.getKeyIdentifierValue(); } WSSecurityEngineResult result = parameters.getData().getWsDocInfo().getResult(uri); if (result != null) { return processPreviousResult(result, secRef, uri, parameters); } return processSTR(secRef, uri, parameters); }
if (WSConstants.WSS_KRB_KI_VALUE_TYPE.equals(valueType)) { byte[] secretKey = STRParserUtil.getSecretKeyFromToken(secRef.getKeyIdentifierValue(), valueType, WSPasswordCallback.SECRET_KEY, data); if (secretKey == null) { parserResult.setPrincipal(new CustomTokenPrincipal(secRef.getKeyIdentifierValue())); String kiValue = secRef.getKeyIdentifierValue(); List<WSSecurityEngineResult> resultsList = data.getWsDocInfo().getResultsByTag(WSConstants.BST);
byte[] secretKey = STRParserUtil.getSecretKeyFromToken( secRef.getKeyIdentifierValue(), keyIdentifierValueType, WSPasswordCallback.SECRET_KEY, data ); byte[] secretKey = STRParserUtil.getSecretKeyFromToken( secRef.getKeyIdentifierValue(), keyIdentifierValueType, WSPasswordCallback.SECRET_KEY, data );
STRParserUtil.checkEncryptedKeyBSPCompliance(secRef, data.getBSPEnforcer()); String id = secRef.getKeyIdentifierValue(); parserResult.setSecretKey( STRParserUtil.getSecretKeyFromToken(id, SecurityTokenReference.ENC_KEY_SHA1_URI,
) throws WSSecurityException { String valueType = secRef.getKeyIdentifierValueType(); byte[] secretKey = STRParserUtil.getSecretKeyFromToken(secRef.getKeyIdentifierValue(), valueType, WSPasswordCallback.SECRET_KEY, data); if (secretKey == null) {