mirror of
https://github.com/corda/corda.git
synced 2025-06-14 05:08:18 +00:00
[ENT-2821] Make the default schemes for TLS and identity available from the CryptoService interface (#4354)
* Make the default schemes for TLS and identity available from the CryptoService interface. * Change CryptoService.generateKeyPair to accept SignatureScheme instead of Int.
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package net.corda.nodeapi.internal.cryptoservice
|
||||
|
||||
import net.corda.core.DoNotImplement
|
||||
import net.corda.core.crypto.SignatureScheme
|
||||
import org.bouncycastle.operator.ContentSigner
|
||||
import java.security.KeyPair
|
||||
import java.security.PublicKey
|
||||
@ -16,7 +17,7 @@ interface CryptoService {
|
||||
*
|
||||
* Returns the [PublicKey] of the generated [KeyPair].
|
||||
*/
|
||||
fun generateKeyPair(alias: String, schemeNumberID: Int): PublicKey
|
||||
fun generateKeyPair(alias: String, scheme: SignatureScheme): PublicKey
|
||||
|
||||
/** Check if this [CryptoService] has a private key entry for the input alias. */
|
||||
fun containsKey(alias: String): Boolean
|
||||
@ -37,6 +38,16 @@ interface CryptoService {
|
||||
* Returns [ContentSigner] for the key identified by the input alias.
|
||||
*/
|
||||
fun getSigner(alias: String): ContentSigner
|
||||
|
||||
/**
|
||||
* Returns the [SignatureScheme] that should be used for generating key pairs for the node's legal identity with this [CryptoService].
|
||||
*/
|
||||
fun defaultIdentitySignatureScheme(): SignatureScheme
|
||||
|
||||
/**
|
||||
* Returns the [SignatureScheme] that should be used with this [CryptoService] when generating key pairs for TLS.
|
||||
*/
|
||||
fun defaultTLSSignatureScheme(): SignatureScheme
|
||||
}
|
||||
|
||||
open class CryptoServiceException(message: String?, cause: Throwable? = null) : Exception(message, cause)
|
||||
|
Reference in New Issue
Block a user