nl_tokens: List a private key by folder and name .
pl_tokens: function listPrivateKey ( keyType , folder , name , noRetry ) { let privateKeyName ; // Try with .key suffix first. If unsuccessful, retry without the .key suffix if ( noRetry ) { // If present, remove '.key' suffix privateKeyName = name . replace ( REG_EXPS . KEY_SUFFIX , '' ) ; } else { // Append '.key' suffix, if not present privateKeyName = ( name . match ( REG_EXPS . KEY_SUFFIX ) ) ? name : ` ${ name } ` ; } return util . runTmshCommand ( ` ${ keyType } ${ folder } ${ privateKeyName } ` ) . then ( ( keyData ) => { // If no result, retry if a retry hasn't occurred yet. if ( ! keyData ) { if ( ! noRetry ) { return listPrivateKey ( keyType , folder , name , true ) ; } return q ( ) ; } return q ( { privateKeyName , keyData } ) ; } ) . catch ( ( err ) => { // If the object is not found (code: 01020036:3), retry if a retry hasn't occurred yet. const notFoundRegex = / 01020036:3 / ; if ( err . message . match ( notFoundRegex ) && ! noRetry ) { return listPrivateKey ( keyType , folder , name , true ) ; } return q . reject ( <mask> ) ; } ) ; }