From 0f7e2dbfd1a0207457f2485e66eb8915102a7d23 Mon Sep 17 00:00:00 2001 From: malachy Date: Wed, 6 Sep 2023 16:15:06 +0100 Subject: [PATCH] CORE-9975: Add javadoc --- .../v5/application/crypto/SigningService.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/application/src/main/java/net/corda/v5/application/crypto/SigningService.java b/application/src/main/java/net/corda/v5/application/crypto/SigningService.java index 5fd96fa46e..37ca1eb57d 100644 --- a/application/src/main/java/net/corda/v5/application/crypto/SigningService.java +++ b/application/src/main/java/net/corda/v5/application/crypto/SigningService.java @@ -41,6 +41,21 @@ public interface SigningService { @NotNull DigitalSignature.WithKeyId sign(@NotNull byte[] bytes, @NotNull PublicKey publicKey, @NotNull SignatureSpec signatureSpec); + /** + * Using the provided signing {@link PublicKey}, internally looks up the matching {@link PrivateKey} and signs the data. + * + * @param bytes The data to sign over using the chosen key. + * @param publicKey The {@link PublicKey} partner to an internally held {@link PrivateKey}, either derived from the node's + * primary identity, or previously generated via the freshKey method. If the {@link PublicKey} is actually + * a {@link CompositeKey}, the first leaf signing key hosted by the node is used. + * @param signatureSpec The {@link SignatureSpec} to use when producing this signature. + * @param context The execution context of the signing operation. + * + * @return A {@link DigitalSignature.WithKeyId} representing the signed data and the {@link PublicKey} that belongs to the + * same {@link KeyPair} as the {@link PrivateKey} that signed the data. + * + * @throws CordaRuntimeException If the input key is not a member of {@code keys}. + */ @Suspendable @NotNull DigitalSignature.WithKeyId sign(@NotNull byte[] bytes, @NotNull PublicKey publicKey, @NotNull SignatureSpec signatureSpec, @NotNull Map context);