Ask a Question

Unable to set the values of a Signature (WS-Security)

SOLVED
CrazyFrog
Contributor

Unable to set the values of a Signature (WS-Security)

I am looking how i can change the values of "Signature"

I use the follow code to create an outgoing WSS and add a entry "Signature"

But i can't fill in the values that belongs to "Signature"

 

        DefaultWssContainer wssContainer = wsdlOperation.getProject().getWssContainer();

        OutgoingWss outgoingWss = wssContainer.addOutgoingWss("Happy-flow");
        outgoingWss.setMustUnderstand(true);
        OutgoingWssConfig outgoingWssConfig = outgoingWss.getConfig();

        WSSEntryConfig wssEntryConfig = outgoingWssConfig.addNewEntry();
        wssEntryConfig.setType("Signature");

Can anybody help me please, somebody from Smartbear @Olga_T 

 

Regards 

 

Raymond

1 ACCEPTED SOLUTION

Accepted Solutions
CrazyFrog
Contributor

Re: Unable to set the values of a Signature (WS-Security)

I found out howto do it.

 

I use the following code herefore.

 

DefaultWssContainer wssContainer = wsdlOperation.getProject().getWssContainer();

OutgoingWss outgoingWss = wssContainer.addOutgoingWss("Happy-flow");
outgoingWss.setMustUnderstand(true);
OutgoingWssConfig outgoingWssConfig = outgoingWss.getConfig();

WSSEntryConfig wssEntryConfig = outgoingWssConfig.addNewEntry();
wssEntryConfig.setType("Signature");

wssEntryConfig.addNewConfiguration();

//https://github.com/oysteing/soapui/tree/master/src/java/com/eviware/soapui/impl/wsdl/support/wss/entries

//https://github.com/oysteing/soapui/blob/master/src/java/com/eviware/soapui/impl/wsdl/support/wss/entries/AddSignatureEntry.java
XmlObjectConfigurationBuilder builder = new XmlObjectConfigurationBuilder();
builder.add( "crypto", "alice.p12" );
builder.add( "keyIdentifierType", 0 );
builder.add( "signatureAlgorithm", XMLSignature.ALGO_ID_MAC_HMAC_SHA384 );
builder.add( "signatureCanonicalization", WSConstants.C14N_OMIT_COMMENTS );
builder.add( "useSingleCert", false );

/* ADDED: digest algorithm to use */
builder.add( "digestAlgorithm", MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA256 );

wssEntryConfig.getConfiguration().set(builder.finish());

 

Only now i need to know howto add parts to. 

View solution in original post

1 REPLY 1
CrazyFrog
Contributor

Re: Unable to set the values of a Signature (WS-Security)

I found out howto do it.

 

I use the following code herefore.

 

DefaultWssContainer wssContainer = wsdlOperation.getProject().getWssContainer();

OutgoingWss outgoingWss = wssContainer.addOutgoingWss("Happy-flow");
outgoingWss.setMustUnderstand(true);
OutgoingWssConfig outgoingWssConfig = outgoingWss.getConfig();

WSSEntryConfig wssEntryConfig = outgoingWssConfig.addNewEntry();
wssEntryConfig.setType("Signature");

wssEntryConfig.addNewConfiguration();

//https://github.com/oysteing/soapui/tree/master/src/java/com/eviware/soapui/impl/wsdl/support/wss/entries

//https://github.com/oysteing/soapui/blob/master/src/java/com/eviware/soapui/impl/wsdl/support/wss/entries/AddSignatureEntry.java
XmlObjectConfigurationBuilder builder = new XmlObjectConfigurationBuilder();
builder.add( "crypto", "alice.p12" );
builder.add( "keyIdentifierType", 0 );
builder.add( "signatureAlgorithm", XMLSignature.ALGO_ID_MAC_HMAC_SHA384 );
builder.add( "signatureCanonicalization", WSConstants.C14N_OMIT_COMMENTS );
builder.add( "useSingleCert", false );

/* ADDED: digest algorithm to use */
builder.add( "digestAlgorithm", MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA256 );

wssEntryConfig.getConfiguration().set(builder.finish());

 

Only now i need to know howto add parts to. 

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: