Need a Java library for generating WSSE headers for API calls

Our API requires WSSE headers to communicate with the server. We presently have generators written in PHP, C# and JavaScript. All produce the same output. We now want a Java library that our customers could integrate into their projects.

What we want out of this project:

1- A code library that customers can integrate into their own projects

2- Unit tests to confirm the code is working as expected

3- Documentation explaining how the code works

The following information is needed to generate a WSSE header:

1- The name of the customer as it appears in the software;

2- A nonce, which is a random string generated by you. This string must be different with each request;

The current date & time in UTC-0. See [login to view URL] for more information;

3- Username – Your username;

4- API token – A unique token assigned to you by us.

The following PHP script demonstrates how to generate a WSSE header. This code can be easily tested using PhpFiddle ([login to view URL]).




$username = "YOUR_USERNAME";

$token = "YOUR_TOKEN";

$key = md5($username);

$cryptAlgo = 'AES-256-CFB';

$iv = mb_substr(base64_decode($token), 0, 16, '8bit');

$secret = base64_encode($iv.openssl_encrypt($token, $cryptAlgo, $key, 0, $iv));


$current_time = date('c');

$nonce = md5(rand(), true);

$base64_nonce = base64_encode($nonce);

$password_digest = base64_encode(sha1($nonce . $current_time . $secret, true));

$header = "UsernameToken Username=\"$username\",".





echo $header;



The following Javascript script demonstrates how to generate a WSSE header. This code can be easily tested using Postman ([login to view URL]).


var moment = require('moment');

var username = "YOUR_USERNAME",


token = "YOUR_TOKEN",

key = [login to view URL](username).toString(),

iv = atob(token).substring(0, 16).toString([login to view URL]),







utf8iv = [login to view URL](iv),

utf8key = [login to view URL](key),

utf8token = [login to view URL](token);

encrypted = [login to view URL](utf8token, utf8key, {

iv: utf8iv,

mode: [login to view URL],

padding: [login to view URL]


secret = btoa(iv + encrypted);

created = moment().utc().format();

created = [login to view URL](0, [login to view URL] - 1) + '+00:00';

nonce = [login to view URL]() * 32767 + '0';

nonce = [login to view URL](nonce).toString();

var stringToSha1 = nonce + created + secret;

var sha1Temp = [login to view URL](stringToSha1, {

asBytes: true


base64Nonce = btoa(nonce);

passwordDigest = [login to view URL](sha1Temp);

header = `UsernameToken Username="${username}",PasswordDigest="${passwordDigest}", Nonce="${base64Nonce}", Created="${created}", Organization="${orgName}"`;


Taidot: AJAX, Java

Näytä lisää: we need an ionic or js library to access odoo api, need class library tropo api, website need java, how to implement ws security in soap request header, how to add header in soap request java, wsse binarysecuritytoken, soap headers java, request does not contain required security header soapui, adding header in soap request, create custom soap header java, how to add security header in soap request, java, api, need java resources job jobs, need java programmer finish project, convert java library dll, api calls sharepoint helpdesk template, java library sound, need java freelancer, definition java library comms

Tietoa työnantajasta:
( 0 arvostelua ) Canada

Projektin tunnus: #17157457

Myönnetty käyttäjälle:


Hello! I have experience with WS security (several projects for the government) and many years with java. So I am happy to help.

$666 CAD 10 päivässä
(1 arvostelu)

10 freelanceria on tarjonnut keskimäärin %project_bid_stats_avg_sub_26% %project_currencyDetails_sign_sub_27% tähän työhön

$555 CAD 10 päivässä
(8 arvostelua)
$555 CAD 10 päivässä
(32 arvostelua)

Hi, I am expert java developer with 8 years of experience of in developing Java/J2EE application. i am very good in Web services development and consuming 3rd party web services. I will develop this utility library w Lisää

$301 CAD 10 päivässä
(30 arvostelua)

Hello Sir, I have huge experience in java development and i worked on consuming SOAP web service in which i generated the WSSE headers. I reviewed your job description and it's look ok to me. I will develop the java l Lisää

$478 CAD 10 päivässä
(62 arvostelua)

Hello, Yours WSSE seems to be an interesting conversion project from php/javascript to Java. Here is my little info on Java background ==> I am working in Java/J2EE technologies for last 16+ years with all latest Lisää

$500 CAD 2 päivässä
(20 arvostelua)
$2000 CAD 5 päivässä
(12 arvostelua)

software developer, java expert with experience dealing with cryptography, checksums and certificates. i can easily do your api

$250 CAD 2 päivässä
(6 arvostelua)

Hi, My name is Xiong Jie Zhao, live in China. I am a newbie in this freelancer, but I have a lot of experiences with Java EE and Java web development using spring framework. I have some skills with API development. Lisää

$400 CAD 2 päivässä
(5 arvostelua)

I have 10+ years experience in Java. I have experience with http so creating library for you will be easy. If you provide current implementation in c# I can port it to Java this approach have advantage that I can Lisää

$555 CAD 10 päivässä
(3 arvostelua)