MCPcopy
hub / github.com/vpulim/node-soap / constructor

Method constructor

src/security/ClientSSLSecurityPFX.ts:21–42  ·  view source on GitHub ↗
(pfx: string | Buffer, passphrase: string, defaults?: any)

Source from the content-addressed store, hash-verified

19 constructor(pfx: string | Buffer, defaults?: any);
20 constructor(pfx: string | Buffer, passphrase: string, defaults?: any);
21 constructor(pfx: string | Buffer, passphrase: string, defaults?: any) {
22 if (typeof passphrase === 'object') {
23 defaults = passphrase;
24 }
25 if (pfx) {
26 if (Buffer.isBuffer(pfx)) {
27 this.pfx = pfx;
28 } else if (typeof pfx === 'string') {
29 this.pfx = fs.readFileSync(pfx);
30 } else {
31 throw new Error('supplied pfx file should be a buffer or a file location');
32 }
33 }
34
35 if (passphrase) {
36 if (typeof passphrase === 'string') {
37 this.passphrase = passphrase;
38 }
39 }
40 this.defaults = {};
41 merge(this.defaults, defaults);
42 }
43
44 public toXML(): string {
45 return '';

Callers

nothing calls this directly

Calls 1

mergeFunction · 0.90

Tested by

no test coverage detected