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

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


     * @param modulas
     * @param exponent
     * @return RSAKeyValue
     */
    public RSAKeyValue newRSAKeyValue(byte[] modulas, byte[] exponent) {
        RSAKeyValue rsaKeyValue = new RSAKeyValue();
        rsaKeyValue.setExponent(exponent);
        rsaKeyValue.setModulus(modulas);
        return rsaKeyValue;
    }
View Full Code Here


                final byte[] paramY = key.getY().toByteArray();
                dsa = signatureFactory.newDSAKeyValue(paramP,paramQ,paramG,paramY,null,null,null);
                keyValue = signatureFactory.newKeyValue(Collections.singletonList(dsa));
               
            } else if (pubKey instanceof java.security.interfaces.RSAPublicKey) {
                RSAKeyValue rsa = null;
                final RSAPublicKey key = (RSAPublicKey)pubKey;
                rsa = signatureFactory.newRSAKeyValue(key.getModulus().toByteArray(),key.getPublicExponent().toByteArray());
                keyValue = signatureFactory.newKeyValue(Collections.singletonList(rsa));
            }else{
                throw new WSTrustException("Unsupported PublicKey");
View Full Code Here

     * @return  KeyValue
     */
    @SuppressWarnings("unchecked")
    protected KeyValue buildKeyValue(PublicKey pubKey) {
        KeyValue kv = new KeyValue();
        RSAKeyValue rsaKV = new RSAKeyValue(pubKey);
        JAXBElement je = new com.sun.xml.security.core.dsig.ObjectFactory().createRSAKeyValue(rsaKV);
        List strList = Collections.singletonList(je);
        kv.setContent(strList);
        return kv;
    }
View Full Code Here

TOP

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

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.