ServiceHub.createSignature - corda

corda / net.corda.core.node / ServiceHub / createSignature

# createSignature

`open fun createSignature(signedTransaction: SignedTransaction, publicKey: PublicKey): TransactionSignature`

Helper method to create an additional signature for an existing (partially) SignedTransaction. Additional SignatureMetadata, including the platform version used during signing and the cryptographic signature scheme use, is added to the signature.

### Parameters

`signedTransaction` - The SignedTransaction to which the signature will apply.

`publicKey` - The PublicKey matching to a signing java.security.PrivateKey hosted in the node. If the PublicKey is actually a net.corda.core.crypto.CompositeKey the first leaf key found locally will be used for signing.

Return
The TransactionSignature generated by signing with the internally held java.security.PrivateKey.

`open fun createSignature(signedTransaction: SignedTransaction): TransactionSignature`

Helper method to create a signature for an existing (partially) SignedTransaction using the default identity signing key of the node. The legal identity key is used to sign. Additional SignatureMetadata, including the platform version used during signing and the cryptographic signature scheme use, is added to the signature.

### Parameters

`signedTransaction` - The SignedTransaction to which the signature will apply.

Return
the TransactionSignature generated by signing with the internally held identity PrivateKey.

`open fun createSignature(filteredTransaction: FilteredTransaction, publicKey: PublicKey): TransactionSignature`

Helper method to create a signature for a FilteredTransaction. Additional SignatureMetadata, including the platform version used during signing and the cryptographic signature scheme use, is added to the signature.

### Parameters

`filteredTransaction` - the FilteredTransaction to which the signature will apply.

`publicKey` - The PublicKey matching to a signing java.security.PrivateKey hosted in the node. If the PublicKey is actually a net.corda.core.crypto.CompositeKey the first leaf key found locally will be used for signing.

Return
The TransactionSignature generated by signing with the internally held java.security.PrivateKey.

`open fun createSignature(filteredTransaction: FilteredTransaction): TransactionSignature`

Helper method to create a signature for a FilteredTransaction using the default identity signing key of the node. The legal identity key is used to sign. Additional SignatureMetadata, including the platform version used during signing and the cryptographic signature scheme use, is added to the signature.

### Parameters

`filteredTransaction` - the FilteredTransaction to which the signature will apply.

Return
the TransactionSignature generated by signing with the internally held identity java.security.PrivateKey.