mirror of
https://github.com/corda/corda.git
synced 2025-06-23 01:19:00 +00:00
ENT-3142: net-params signing tool: include certificate path in signature (#5165)
This commit is contained in:
@ -493,6 +493,13 @@ fun <T : Any> T.signWithCert(privateKey: PrivateKey, certificate: X509Certificat
|
||||
}
|
||||
}
|
||||
|
||||
@DeleteForDJVM
|
||||
fun <T : Any> T.signWithCertPath(privateKey: PrivateKey, certPath: List<X509Certificate>): SignedDataWithCert<T> {
|
||||
return signWithCert {
|
||||
val signature = Crypto.doSign(privateKey, it.bytes)
|
||||
DigitalSignatureWithCert(certPath.first(), certPath.takeLast(certPath.size - 1), signature)
|
||||
}
|
||||
}
|
||||
@DeleteForDJVM
|
||||
inline fun <T : Any> SerializedBytes<T>.sign(signer: (SerializedBytes<T>) -> DigitalSignature.WithKey): SignedData<T> {
|
||||
return SignedData(this, signer(this))
|
||||
|
Reference in New Issue
Block a user