Package com.sun.xml.wss.impl

Examples of com.sun.xml.wss.impl.SecurityTokenException


            String encodedData = XMLUtil.getFullTextFromChildren(this);
            try {
                data = Base64.decode(encodedData);
            } catch (Base64DecodingException bde) {
                log.log(Level.SEVERE, "WSS0301.unableto.decode.data");
                throw new SecurityTokenException("Unable to decode data", bde);
            }
            try {
                CertificateFactory certFact = CertificateFactory.getInstance("X.509");
                cert = (X509Certificate) certFact.generateCertificate(new ByteArrayInputStream(data));
            } catch (Exception e) {
View Full Code Here


    private void checkCertVersion() throws SecurityTokenException {
        if (cert.getVersion() != 3||cert.getVersion() !=1) {
            log.log(Level.SEVERE,
                    "WSS0392.invalid.X509cert.version",
                    Integer.toString(cert.getVersion()));
            throw new SecurityTokenException(
                "Expected Version 1 or 3 Certificate, found Version " +
                cert.getVersion());
        }
    }
View Full Code Here

        String valueType = getAttribute("ValueType");

        // BSP:3031: ValueType MUST always be specified
        if (isBSP && valueType.length()<1) {
            log.log(Level.SEVERE, "BSP3031.ValueType.NotPresent");
            throw new SecurityTokenException("Any wsse:BinarySecurityToken in a SECURE_ENVELOPE MUST have an ValueType attribute.");
        }
        
        if (!"".equals(valueType)) {       
            setValueType(valueType);
        }
       
        if (isBSP) {
            String encoding = getAttribute("EncodingType");

            // BSP:R3029: encodingType MUST be specified.               
            if (encodingType.length()<1) {
                log.log(Level.SEVERE, "BSP3029.EncodingType.NotPresent");
                throw new SecurityTokenException("Any wsse:BinarySecurityToken in a SECURE_ENVELOPE MUST have an EncodingType attribute.");
            }

            if (!encodingType.equalsIgnoreCase(MessageConstants.BASE64_ENCODING_NS))
            {
                log.log(Level.SEVERE, "BSP3030.EncodingType.Invalid");
                throw new SecurityTokenException("EncodingType attribute value in wsse:BinarySecurityToken is invalid.");           
            }
           
            if (!"".equals(encoding)) {
                setEncodingType(encoding);
            }               
View Full Code Here

    public byte[] getRawValue() throws SecurityTokenException {
        try {
            return Base64.decode(encodedText);
        } catch (Base64DecodingException bde) {
            log.log(Level.SEVERE, "WSS0344.error.decoding.bst")
            throw new SecurityTokenException(bde);
        }
    }
View Full Code Here

           
            addTextNode(getTextValue());
           
        } catch (Exception e) {           
            log.log(Level.SEVERE,"WSS0343.error.creating.bst", e.getMessage());           
            throw new SecurityTokenException(
                "There was an error in creating the BinarySecurityToken "  +
                e.getMessage());
        }
        return delegateElement;       
    }
View Full Code Here

       
        this.contextDocument = getOwnerDocument();
       
        if (!("SecurityContextToken".equals(getLocalName()) &&
                XMLUtil.inWsscNS(this))) {
            throw new SecurityTokenException(
                    "Expected wsc:SecurityContextToken Element, but Found " + getPrefix() + ":" + getLocalName());
        }
       
        String wsuIdVal = getAttributeNS(MessageConstants.WSU_NS, "Id");
        if (!"".equals(wsuIdVal)) {
View Full Code Here

                    appendChild(newElement);
                }
            }
           
        } catch (SOAPException se) {
            throw new SecurityTokenException(
                    "There was an error creating SecurityContextToken " +
                    se.getMessage());
        }
       
        return super.getAsSoapElement();
View Full Code Here

            String encodedData = XMLUtil.getFullTextFromChildren(this);
            try {
                data = Base64.decode(encodedData);
            } catch (Base64DecodingException bde) {
                log.log(Level.SEVERE, "WSS0301.unableto.decode.data");
                throw new SecurityTokenException("Unable to decode data", bde);
            }
            try {
                CertificateFactory certFact = CertificateFactory.getInstance("X.509");
                cert = (X509Certificate) certFact.generateCertificate(new ByteArrayInputStream(data));
            } catch (Exception e) {
View Full Code Here

    private void checkCertVersion() throws SecurityTokenException {
        if (cert.getVersion() != 3||cert.getVersion() !=1) {
            log.log(Level.SEVERE,
                    "WSS0392.invalid.X509cert.version",
                    Integer.toString(cert.getVersion()));
            throw new SecurityTokenException(
                "Expected Version 1 or 3 Certificate, found Version " +
                cert.getVersion());
        }
    }
View Full Code Here

        if (setCreatedTimestamp) {
            try {
                this.created = getCreatedFromTimestamp();
            } catch (Exception e) {
                log.log(Level.SEVERE, "WSS0280.failed.create.UsernameToken", e);
                throw new SecurityTokenException(e);
            }
        }       
    }
View Full Code Here

TOP

Related Classes of com.sun.xml.wss.impl.SecurityTokenException

Copyright © 2018 www.massapicom. 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.