File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
onixlabs-corda-core-contract/src/main/kotlin/io/onixlabs/corda/core/contract Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,27 @@ import java.util.*
2020data class SignatureData (private val content : ByteArray , private val signature : DigitalSignature ) {
2121
2222 companion object {
23+
24+ /* *
25+ * Creates a signature from the specified content and private key.
26+ *
27+ * @param content The content to sign.
28+ * @param privateKey The private key to sign the content.
29+ * @return Returns a new signature containing the content and signed data.
30+ */
2331 fun create (content : ByteArray , privateKey : PrivateKey ): SignatureData {
2432 val signature = privateKey.sign(content)
2533 return SignatureData (content, signature)
2634 }
2735
36+ /* *
37+ * Creates a signature from the specified content by resolving the signing key from the service hub.
38+ *
39+ * @param content The content to sign.
40+ * @param publicKey The public key to resolve from the service hub.
41+ * @param serviceHub The service hub to resolve the public key.
42+ * @return Returns a new signature containing the content and signed data.
43+ */
2844 fun create (content : ByteArray , publicKey : PublicKey , serviceHub : ServiceHub ): SignatureData {
2945 val signature = serviceHub.keyManagementService.sign(content, publicKey)
3046 return SignatureData (content, signature.withoutKey())
You can’t perform that action at this time.
0 commit comments