src/crypto/openssl.js
function createCsrSubject(opts) {
    const data = {
        C: opts.country,
        ST: opts.state,
        L: opts.locality,
        O: opts.organization,
        OU: opts.organizationUnit,
        CN: opts.commonName || 'localhost',
        emailAddress: opts.emailAddress
    };

    return Object.entries(data).map(([key, value]) => {
        value = (value || '').replace(/[^\w .*,@'-]+/g, ' ').trim();
        return value ? `/${key}=${value}` : '';
    }).join('');
}
function createCsrSubject(opts) {
    const data = {
        C: opts.country,
        ST: opts.state,
        L: opts.locality,
        O: opts.organization,
        OU: opts.organizationUnit,
        CN: opts.commonName || 'localhost',
        emailAddress: opts.emailAddress
    };

    return Object.entries(data).map(([key, value]) => {
        value = (value || '').replace(/[^\w .*,@'-]+/g, ' ').trim();
        return value ? `/${key}=${value}` : '';
    }).join('');
}
function createCsrSubject ( opts ) { const data = { C : opts . country , ST : opts . state , L : opts . locality , O : opts . organization , OU : opts . organizationUnit , CN : opts . commonName || 'localhost' , emailAddress : opts . emailAddress } ; return Object . entries ( data ) . map ( ( [ key , value ] ) => { value = ( value || '' ) . replace ( / [^\w .*,@'-]+ / g , ' ' ) . trim ( ) ; return value ? ` ${ key } ${ value } ` : '' ; } ) . join ( '' ) ; }
Create Certificate Signing Request subject

@private
@param {object} opts CSR subject options
@returns {string} CSR subject
Create Certificate Signing Request subject