Skip to content

Commit

Permalink
CORE-9975: Add javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
malachyb committed Sep 6, 2023
1 parent 86a9879 commit 298c462
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> context);
Expand Down

0 comments on commit 298c462

Please sign in to comment.