corda / com.r3.corda.networkmanage.common.cryptoservice.securosys / SecurosysPrimusXCryptoService

SecurosysPrimusXCryptoService

class SecurosysPrimusXCryptoService : JCACryptoService<SecurosysAuthenticationCredentials, SecurosysKeyConfig>

Constructors

<init>

SecurosysPrimusXCryptoService(keyStore: KeyStore, provider: Provider, host: String, port: Int)

Functions

authenticate

fun authenticate(credentials: SecurosysAuthenticationCredentials): Unit

Authenticate a user against the underlying crypto provider using given credentials.

generateAndStoreKeyPair

fun generateAndStoreKeyPair(keyConfig: SecurosysKeyConfig): PublicKey

Generate a key pair and a basic self-signed certificate and store within the underlying key store.

getAuthenticatedUsers

fun getAuthenticatedUsers(): List<String>

Return the list of users currently authenticated against the underlying crypto provider.

isAuthenticated

fun isAuthenticated(): Boolean

Boolean flag indicating whether further authentication is needed to use stored keys.

logOut

fun logOut(): Unit

Reset the authentication state for the underlying crypto provider.

updateCertificate

fun updateCertificate(keyConfig: SecurosysKeyConfig, certificateChain: List<X509Certificate>): Unit

Update the certificate chain within the underlying key store.

Inherited Functions

containsKey

open fun containsKey(alias: String): Boolean

Check if this CryptoService contains an entry for the given alias.

delete

open fun delete(alias: String): Unit

ensureAuthenticated

open fun <T> ensureAuthenticated(block: () -> T): T

generateRandomLong

open fun generateRandomLong(): Long

Generate a random Long using the underlying Provider.

getCertificate

open fun getCertificate(alias: String): Certificate

Returns the Certificate of the entry for the given alias.

getPublicKey

open fun getPublicKey(alias: String): PublicKey

Returns the PublicKey of the entry for the given alias.

getSigner

open fun getSigner(alias: String, password: String?): <ERROR CLASS>

Returns ContentSigner for the key identified by the input alias.

sign

open fun sign(alias: String, data: ByteArray, signAlgorithm: String?, password: String?): ByteArray

Sign a ByteArray using the private key identified by the input alias. Returns the signature bytes formatted according to the signature scheme. The signAlgorithm if specified determines the signature scheme used for signing, if not specified then the signature scheme is based on the private key scheme.

Companion Object Properties

KEY_TYPE

const val KEY_TYPE: String