Package com.sun.xml.ws.security.secext11

Examples of com.sun.xml.ws.security.secext11.SignatureConfirmationType


        }
        return new JAXBEncryptedData(edt,attachData,key,soapVersion);
    }
   
    public EncryptedHeader createEncryptedHeader(String ehId, String edId,Data data,String dataAlgo,KeyInfoType keyInfo,Key key,boolean contentOnly){
        EncryptedHeaderType eht = new EncryptedHeaderType();
        EncryptedDataType edt = new EncryptedDataType();
        if(contentOnly){
            // TODO: not valid, need to throw exception here
            edt.setType(MessageConstants.ENCRYPT_ELEMENT_CONTENT);
        }else{
            edt.setType(MessageConstants.ENCRYPT_ELEMENT);
        }
        EncryptionMethodType emt = new EncryptionMethodType();
        emt.setAlgorithm(dataAlgo);
        edt.setEncryptionMethod(emt);
        CipherDataType ct = new CipherDataType();
        ct.setCipherValue("ed".getBytes());
        edt.setCipherData(ct);
        edt.setId(edId);
        if(keyInfo != null){
            edt.setKeyInfo(keyInfo);
        }
        eht.setEncryptedData(edt);
        eht.setId(ehId);
        if(soapVersion == SOAPVersion.SOAP_11) {
            eht.setMustUnderstand(true);
        }else if(soapVersion == SOAPVersion.SOAP_12){
            eht.setMustUnderstand12(true);
        }
        EncryptedHeader eh =  new EncryptedHeader(eht, data, key, soapVersion);
        return eh;
    }
View Full Code Here


        }
        return new JAXBEncryptedData(edt,attachData,key,soapVersion);
    }
   
    public EncryptedHeader createEncryptedHeader(String ehId, String edId,Data data,String dataAlgo,KeyInfoType keyInfo,Key key,boolean contentOnly){
        EncryptedHeaderType eht = new EncryptedHeaderType();
        EncryptedDataType edt = new EncryptedDataType();
        if(contentOnly){
            // TODO: not valid, need to throw exception here
            edt.setType(MessageConstants.ENCRYPT_ELEMENT_CONTENT);
        }else{
            edt.setType(MessageConstants.ENCRYPT_ELEMENT);
        }
        EncryptionMethodType emt = new EncryptionMethodType();
        emt.setAlgorithm(dataAlgo);
        edt.setEncryptionMethod(emt);
        CipherDataType ct = new CipherDataType();
        ct.setCipherValue("ed".getBytes());
        edt.setCipherData(ct);
        edt.setId(edId);
        if(keyInfo != null){
            edt.setKeyInfo(keyInfo);
        }
        eht.setEncryptedData(edt);
        eht.setId(ehId);
        if(soapVersion == SOAPVersion.SOAP_11) {
            eht.setMustUnderstand(true);
        }else if(soapVersion == SOAPVersion.SOAP_12){
            eht.setMustUnderstand12(true);
        }
        EncryptedHeader eh =  new EncryptedHeader(eht, data, key, soapVersion);
        return eh;
    }
View Full Code Here

    @Override
    public void handle(final InputProcessorChain inputProcessorChain, final XMLSecurityProperties securityProperties,
                       Deque<XMLSecEvent> eventQueue, Integer index) throws XMLSecurityException {

        @SuppressWarnings("unchecked")
        final SignatureConfirmationType signatureConfirmationType =
                ((JAXBElement<SignatureConfirmationType>) parseStructure(eventQueue, index, securityProperties)).getValue();

        checkBSPCompliance(inputProcessorChain, signatureConfirmationType);

        inputProcessorChain.getSecurityContext().putAsList(SignatureConfirmationType.class, signatureConfirmationType);

        //emit a SignatureConfirmationSecurityEvent
        SignatureConfirmationSecurityEvent signatureConfirmationSecurityEvent = new SignatureConfirmationSecurityEvent();
        signatureConfirmationSecurityEvent.setSignatureValue(signatureConfirmationType.getValue());
        inputProcessorChain.getSecurityContext().registerSecurityEvent(signatureConfirmationSecurityEvent);
    }
View Full Code Here

                    byte[] signatureValue = signatureValueSecurityEvent.getSignatureValue();

                    boolean found = false;

                    for (int j = 0; j < signatureConfirmationTypeList.size(); j++) {
                        SignatureConfirmationType signatureConfirmationType = signatureConfirmationTypeList.get(j);
                        byte[] sigConfValue = signatureConfirmationType.getValue();
                        if (Arrays.equals(signatureValue, sigConfValue)) {
                            found = true;
                        }
                    }
View Full Code Here

TOP

Related Classes of com.sun.xml.ws.security.secext11.SignatureConfirmationType

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.