Package com.sun.xml.ws.security.opt.crypto.dsig.keyinfo

Examples of com.sun.xml.ws.security.opt.crypto.dsig.keyinfo.X509Data


     * @param content
     * @return X509Data
     */
    @SuppressWarnings("unchecked")
    public X509Data newX509Data(List content) {
        X509Data x509Data = new X509Data();
        x509Data.setX509IssuerSerialOrX509SKIOrX509SubjectName(content);
        return x509Data;
    }
View Full Code Here


                final BinarySecret secret = eleFac.createBinarySecret(key, wstVer.getSymmetricKeyTypeURI());
                keyInfo.getContent().add(secret);
            }
        }else if(WSTrustConstants.PUBLIC_KEY.equals(keyType)){
           
            final X509Data x509Data = new X509Data();
            final Set certs = ctx.getRequestorSubject().getPublicCredentials();
            if(certs == null){
                log.log(Level.SEVERE,
                        LogStringsMessages.WST_0034_UNABLE_GET_CLIENT_CERT());
                throw new WSTrustException(LogStringsMessages.WST_0034_UNABLE_GET_CLIENT_CERT());
            }
            boolean addedClientCert = false;
            final ObjectFactory dsigOF = new ObjectFactory();
            for(Object o : certs){
                if(o instanceof X509Certificate){
                    final X509Certificate clientCert = (X509Certificate)o;
                   
                    JAXBElement<byte[]> certElement;
                    try {
                        certElement = dsigOF.createX509DataTypeX509Certificate(clientCert.getEncoded());
                    } catch (CertificateEncodingException ex) {
                        //ex.printStackTrace();
                        throw new WSTrustException("Unable to create KeyInfo",ex);
                    }
                    @SuppressWarnings("unchecked") final List<Object> x509DataContent = x509Data.getContent();
                    x509DataContent.add(certElement);
                    addedClientCert = true;
                   
                }
            }
View Full Code Here

TOP

Related Classes of com.sun.xml.ws.security.opt.crypto.dsig.keyinfo.X509Data

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.