Examples of CryptoProcessor


Examples of com.sun.xml.ws.security.opt.impl.enc.CryptoProcessor

    public InputStream getCipherInputStream() throws XWSSecurityException{
        if(dataEncKey == null){
            logger.log(Level.SEVERE, LogStringsMessages.WSS_1926_ED_KEY_NOTSET());
            throw SOAPUtil.newSOAPFaultException(MessageConstants.WSSE_FAILED_CHECK,LogStringsMessages.WSS_1926_ED_KEY_NOTSET(),null);
        }
        cp = new CryptoProcessor(Cipher.DECRYPT_MODE,encryptionMethod,dataEncKey);
        try {
            cin = cp.decryptData(cdp.readAsStream());
        } catch (IOException ex) {
            logger.log(Level.SEVERE, LogStringsMessages.WSS_1927_ERROR_DECRYPT_ED("EncryptedData"));
            throw SOAPUtil.newSOAPFaultException(MessageConstants.WSSE_FAILED_CHECK,LogStringsMessages.WSS_1927_ERROR_DECRYPT_ED("EncryptedData"),ex);
View Full Code Here

Examples of com.sun.xml.ws.security.opt.impl.enc.CryptoProcessor

        if(decryptedMimeData == null){
            if(dataEncKey == null){
                logger.log(Level.SEVERE, LogStringsMessages.WSS_1926_ED_KEY_NOTSET());
                throw SOAPUtil.newSOAPFaultException(MessageConstants.WSSE_FAILED_CHECK,LogStringsMessages.WSS_1926_ED_KEY_NOTSET(),null);
            }
            cp = new CryptoProcessor(Cipher.DECRYPT_MODE,encryptionMethod,dataEncKey);
            try {
                decryptedMimeData = cp.decryptData(cdp.readAsBytes());
            } catch (IOException ex) {
                logger.log(Level.SEVERE, LogStringsMessages.WSS_1927_ERROR_DECRYPT_ED("EncryptedData"));
                throw SOAPUtil.newSOAPFaultException(MessageConstants.WSSE_FAILED_CHECK,LogStringsMessages.WSS_1927_ERROR_DECRYPT_ED("EncryptedData"),ex);
View Full Code Here

Examples of com.sun.xml.ws.security.opt.impl.enc.CryptoProcessor

                                }
                            } catch(NoSuchAlgorithmException nsae){
                                throw new XWSSecurityException(nsae);
                            }
                        }
                        cp = new CryptoProcessor(Cipher.UNWRAP_MODE,encryptionMethod,keyEncKey);
                       
                        break;
                    }
                    default :{
                        if(StreamUtil.isStartElement(reader)){
View Full Code Here

Examples of com.sun.xml.ws.security.opt.impl.enc.CryptoProcessor

        throw new UnsupportedOperationException();
    }
   
    public void writeTo(Object obj, String mimeType,OutputStream os)throws IOException{
        if(obj instanceof CryptoProcessor){
            CryptoProcessor cp = (CryptoProcessor) obj;           
            cp.encrypt(os);           
        }else{
            throw new UnsupportedOperationException();
        }
    }   
View Full Code Here

Examples of com.sun.xml.ws.security.opt.impl.enc.CryptoProcessor

        part.setContentId(getContentId());
        saaj.addAttachmentPart(part);
    }
   
    private void doEncryption() throws XWSSecurityException{
        CryptoProcessor dep = new CryptoProcessor(Cipher.ENCRYPT_MODE, dataAlgo, key);
        data = dep.encryptData(attachment.asByteArray());
    }
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.