src/crypto/openssl.js
function getAction(key) {
    const keyString = key.toString();

    if (keyString.match(/CERTIFICATE\sREQUEST-{5}$/m)) {
        return 'req';
    }
    else if (keyString.match(/(PUBLIC|PRIVATE)\sKEY-{5}$/m)) {
        return 'rsa';
    }

    return 'x509';
}
function getAction(key) {
    const keyString = key.toString();

    if (keyString.match(/CERTIFICATE\sREQUEST-{5}$/m)) {
        return 'req';
    }
    else if (keyString.match(/(PUBLIC|PRIVATE)\sKEY-{5}$/m)) {
        return 'rsa';
    }

    return 'x509';
}
function getAction ( key ) { const keyString = key . toString ( ) ; if ( keyString . match ( / CERTIFICATE\sREQUEST-{5}$ / m ) ) { return 'req' ; } else if ( keyString . match ( / (PUBLIC|PRIVATE)\sKEY-{5}$ / m ) ) { return 'rsa' ; } return 'x509' ; }
Get OpenSSL action from buffer

@private
@param {buffer} key Private key, certificate or CSR
@returns {string} OpenSSL action
Get OpenSSL action from buffer