Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the WSSecurityCert option no work #617

Open
isaacgrimaldo opened this issue Sep 1, 2023 · 0 comments
Open

the WSSecurityCert option no work #617

isaacgrimaldo opened this issue Sep 1, 2023 · 0 comments
Labels

Comments

@isaacgrimaldo
Copy link

  • The options WSSecurityCertm, when past the param options the class not use it
  the prefix not change
  const cerft = new soap.WSSecurityCert(certpri, ca, 'kpseos123', {
     prefix: 'ds',
   });

Additional information

i checked the core class, the class never user that param

class WSSecurityCert extends Security {
  constructor(privatePEM, publicP12PEM, password) {
    super();
    this.publicP12PEM = publicP12PEM.toString().replace('-----BEGIN CERTIFICATE-----', '').replace('-----END CERTIFICATE-----', '').replace(/(\r\n|\n|\r)/gm, '');
    this.signer = new SignedXml();
    this.signer.signingKey = this.getSigningKey(privatePEM, password);
    this.x509Id = 'x509-' + generateId();
    var references = ['http://www.w3.org/2000/09/xmldsig#enveloped-signature', 'http://www.w3.org/2001/10/xml-exc-c14n#'];
    this.signer.addReference('//*[local-name(.)=\'Body\']', references);
    this.signer.addReference('//*[local-name(.)=\'Timestamp\']', references);
    var _this = this;
    this.signer.keyInfoProvider = {};
    this.signer.keyInfoProvider.getKeyInfo = function (key) {
      var x509Id = _this.x509Id;
      var xml = `<wsse:SecurityTokenReference>
    <wsse:Reference URI="${x509Id}" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
    </wsse:SecurityTokenReference>`;
      return xml;
    };
  }
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Icebox
Development

No branches or pull requests

2 participants