Package org.apache.ws.security.message.token

Examples of org.apache.ws.security.message.token.SecurityTokenReference.containsKeyIdentifier()


                        }
                    }
                }
            } else if (secRef.containsX509Data() || secRef.containsX509IssuerSerial()) {
                certs = secRef.getX509IssuerSerial(crypto);
            } else if (secRef.containsKeyIdentifier()) {
              if (secRef.getKeyIdentifierValueType().equals
                  (SecurityTokenReference.ENC_KEY_SHA1_URI)) {
                   
                String id = secRef.getKeyIdentifierValue();
                    WSPasswordCallback pwcb = new WSPasswordCallback(id,
View Full Code Here


                        .getSamlTokenElement(), crypto, cb);
                //TODO Handle malformed SAML tokens where they don't have the
                //secret in them
                decryptedData = keyInfo.getSecret();
            }
    } else if (secRef.containsKeyIdentifier()){
     
      if ( secRef.getKeyIdentifierValueType().equals(SecurityTokenReference.ENC_KEY_SHA1_URI)) {
         
        String sha = secRef.getKeyIdentifierValue();
       
View Full Code Here

                * If wsse:KeyIdentifier found, then the public key of the attached cert was used to
                * encrypt the session (symmetric) key that encrypts the data. Extract the certificate
                * using the BinarySecurity token (was enhanced to handle KeyIdentifier too).
                * This method is _not_ recommended by OASIS WS-S specification, X509 profile
                */
                else if (secRef.containsKeyIdentifier()) {
                    X509Certificate[] certs = secRef.getKeyIdentifier(crypto);
                    if (certs == null || certs.length < 1 || certs[0] == null) {
                        throw new WSSecurityException(WSSecurityException.FAILURE,
                                "invalidX509Data", new Object[]{"for decryption (KeyId)"});
                    }
View Full Code Here

                    secretKey = samlKi.getSecret();
                    publicKey = samlKi.getPublicKey();
                }
            } else if (secRef.containsX509Data() || secRef.containsX509IssuerSerial()) {
                certs = secRef.getX509IssuerSerial(crypto);
            } else if (secRef.containsKeyIdentifier()) {
                if (secRef.getKeyIdentifierValueType().equals(SecurityTokenReference.ENC_KEY_SHA1_URI)) {
                    String id = secRef.getKeyIdentifierValue();
                    WSPasswordCallback pwcb =
                        new WSPasswordCallback(
                            id,
View Full Code Here

                    .toString() });
          }
        }
      } else if (secRef.containsX509IssuerSerial()) {
        certs = secRef.getX509IssuerSerial(crypto);
      } else if (secRef.containsKeyIdentifier()) {
        certs = secRef.getKeyIdentifier(crypto);
      } else {
        throw new WSSecurityException(
            WSSecurityException.INVALID_SECURITY,
            "unsupportedKeyInfo", new Object[] { node.toString() });
View Full Code Here

                * If wsse:KeyIdentifier found, then the public key of the attached cert was used to
                * encrypt the session (symmetric) key that encrypts the data. Extract the certificate
                * using the BinarySecurity token (was enhanced to handle KeyIdentifier too).
                * This method is _not_recommended by OASIS WS-S specification, X509 profile
                */
                else if (secRef.containsKeyIdentifier()) {
                    X509Certificate[] certs = secRef.getKeyIdentifier(crypto);
                    if (certs == null || certs.length < 1 || certs[0] == null) {
                        throw new WSSecurityException(WSSecurityException.FAILURE,
                                "invalidX509Data", new Object[]{"for decryption (KeyId)"});
                    }
View Full Code Here

           
            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);
            }
View Full Code Here

           
            try {
                SecurityTokenReference str = new SecurityTokenReference((Element)elem);
                if (str.containsReference()) {
                    tokenId = str.getReference().getURI();
                } else if(str.containsKeyIdentifier()){
                  tokenId = str.getKeyIdentifierValue();
                }
                if(tokenId == null){
                    if(str.containsKeyIdentifier()){
                        tokenId = str.getKeyIdentifierValue();
View Full Code Here

                    tokenId = str.getReference().getURI();
                } else if(str.containsKeyIdentifier()){
                  tokenId = str.getKeyIdentifierValue();
                }
                if(tokenId == null){
                    if(str.containsKeyIdentifier()){
                        tokenId = str.getKeyIdentifierValue();
                    }
                }
            } catch (WSSecurityException e) {
                throw new TrustException("errorExtractingTokenId",e);
View Full Code Here

                    .toString() });
          }
        }
      } else if (secRef.containsX509IssuerSerial()) {
        certs = secRef.getX509IssuerSerial(crypto);
      } else if (secRef.containsKeyIdentifier()) {
        certs = secRef.getKeyIdentifier(crypto);
      } else {
        throw new WSSecurityException(
            WSSecurityException.INVALID_SECURITY,
            "unsupportedKeyInfo", new Object[] { node.toString() });
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.