@Override public int hashCode() { int result = 17; String uri = getURI(); if (uri != null) { result = 31 * result + uri.hashCode(); } String valueType = getValueType(); if (valueType != null) { result = 31 * result + valueType.hashCode(); } return result; }
@Override public int hashCode() { int result = 17; String uri = getURI(); if (uri != null) { result = 31 * result + uri.hashCode(); } String valueType = getValueType(); if (valueType != null) { result = 31 * result + valueType.hashCode(); } return result; }
/** * Constructor. * * @param elem The Reference element * @throws WSSecurityException */ public Reference(Element elem) throws WSSecurityException { if (elem == null) { throw new WSSecurityException(WSSecurityException.INVALID_SECURITY, "noReference"); } element = elem; QName el = new QName(element.getNamespaceURI(), element.getLocalName()); if (!el.equals(TOKEN)) { throw new WSSecurityException( WSSecurityException.FAILURE, "badElement", new Object[] {TOKEN, el} ); } String uri = getURI(); // Reference URI cannot be null or empty if (uri == null || "".equals(uri)) { throw new WSSecurityException( WSSecurityException.INVALID_SECURITY, "badReferenceURI" ); } }
/** * Constructor. * * @param elem The Reference element * @throws WSSecurityException */ public Reference(Element elem) throws WSSecurityException { if (elem == null) { throw new WSSecurityException(WSSecurityException.INVALID_SECURITY, "noReference"); } element = elem; QName el = new QName(element.getNamespaceURI(), element.getLocalName()); if (!el.equals(TOKEN)) { throw new WSSecurityException( WSSecurityException.FAILURE, "badElement", new Object[] {TOKEN, el} ); } String uri = getURI(); // Reference URI cannot be null or empty if (uri == null || "".equals(uri)) { throw new WSSecurityException( WSSecurityException.INVALID_SECURITY, "badReferenceURI" ); } }
String valueType = null; if (ref != null) { uri = ref.getURI(); valueType = ref.getValueType(); } else {
String valueType = null; if (ref != null) { uri = ref.getURI(); valueType = ref.getValueType(); } else {
private void processValidateTarget()throws TrustException{ OMElement validateTargetElem = this.rstElement .getFirstChildWithName(new QName(this.wstNs, RahasConstants.LocalNames.VALIDATE_TARGET)); if (validateTargetElem != null) { OMElement strElem = validateTargetElem.getFirstChildWithName(new QName(WSConstants.WSSE_NS, "SecurityTokenReference")); Element elem = (Element)OMXMLBuilderFactory.createStAXOMBuilder( OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory(), strElem.getXMLStreamReader()).getDocumentElement(); try { SecurityTokenReference str = new SecurityTokenReference((Element)elem); if (str.containsReference()) { tokenId = str.getReference().getURI(); } else if(str.containsKeyIdentifier()){ tokenId = str.getKeyIdentifierValue(); } } catch (WSSecurityException e) { throw new TrustException("errorExtractingTokenId",e); } } }
uri = secRef.getReference().getURI(); if (uri.charAt(0) == '#') { uri = uri.substring(1);
uri = secRef.getReference().getURI(); if (uri.charAt(0) == '#') { uri = uri.substring(1);
SecurityTokenReference str = new SecurityTokenReference((Element)elem); if (str.containsReference()) { tokenId = str.getReference().getURI(); } else if(str.containsKeyIdentifier()){ tokenId = str.getKeyIdentifierValue();
/** * 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.containsReference()) { basetokenId = securityTokenReference.getReference().getURI(); if (basetokenId.charAt(0) == '#') { basetokenId = basetokenId.substring(1); } } else { // KeyIdentifier basetokenId = securityTokenReference.getKeyIdentifierValue(); } principal.setBasetokenId(basetokenId); return principal; }
/** * 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.containsReference()) { basetokenId = securityTokenReference.getReference().getURI(); if (basetokenId.charAt(0) == '#') { basetokenId = basetokenId.substring(1); } } else { // KeyIdentifier basetokenId = securityTokenReference.getKeyIdentifierValue(); } principal.setBasetokenId(basetokenId); return principal; }
uri = secRef.getReference().getURI(); if (uri.charAt(0) == '#') { uri = uri.substring(1);
uri = secRef.getReference().getURI(); if (uri.charAt(0) == '#') { uri = uri.substring(1);
uri = secRef.getReference().getURI(); if (uri.charAt(0) == '#') { uri = uri.substring(1);
uri = secRef.getReference().getURI(); if (uri.charAt(0) == '#') { uri = uri.substring(1);
uri = secRef.getReference().getURI(); if (uri.charAt(0) == '#') { uri = uri.substring(1);
uri = secRef.getReference().getURI(); if (uri.charAt(0) == '#') { uri = uri.substring(1);