corda / com.r3.corda.networkmanage.common.hsm.authentication / CryptoServiceAuthenticator

CryptoServiceAuthenticator

class CryptoServiceAuthenticator<T, U : AuthenticationCredentials, V : KeyConfig>

Class responsible for handling authentication of the cryptoService. Supports the ability to prompt the user for required credentials as well as resetting of the cryptoService authentication state once the desired tasks have been run.

Parameters

cryptoService - crypto service used to execute the signing/key generation tasks.

credentialsConfigs - list of authentication credentials configuration objects for the cryptoService.

credentialsTransformer - transformer that converts each credentials config into a fully formed credentials object that can be used to authenticate the cryptoService.

ctx_ - logging context for authentication operations

Constructors

<init>

CryptoServiceAuthenticator(cryptoService: CryptoService<U, V>, credentialsConfigs: List<T>, credentialsTransformer: CredentialsTransformer<T, U>, ctx_: <ERROR CLASS>)

Class responsible for handling authentication of the cryptoService. Supports the ability to prompt the user for required credentials as well as resetting of the cryptoService authentication state once the desired tasks have been run.

Properties

ctx

val ctx: <ERROR CLASS>

Functions

close

fun close(renderer: Renderer = LoggingRenderer(ctx)): Unit

connectAndAuthenticate

fun <T> connectAndAuthenticate(headless: Boolean = false, renderer: Renderer = LoggingRenderer(ctx), logOff: Boolean = true, userInfo: <ERROR CLASS>? = null, block: (CryptoService<U, V>) -> T): T

Interactively (using console) authenticates a user against the crypto service. Once authentication is successful the block is executed.