Signer API Reference
This document provides a concise API reference for the Signer
class within the Hedera DID SDK for JavaScript. This class is responsible for generating key pairs, signing data, and verifying signatures.
Class Diagram
The class diagram below illustrates the core methods of the Signer
interface for interacting with cryptographic keys.

Methods
publicKey
publicKey(): Promise<string>
Returns the public key associated with the Signer
instance in DER format.
- Returns
-
-
The public key in DER format.
-
publicKeyInstance
publicKeyInstance(): Promise<PublicKey>
Returns Hiero SDK public key instance associated with the Signer
instance.
- Returns
-
-
Hiero SDK public key instance.
-
sign
sign(message: Uint8Array): Promise<Uint8Array>
Signs the given message using the private key and returns the signature.
- Parameters
-
-
message
: The message to be signed.
-
- Returns
-
-
The signature of the message.
-
Errors
Exception code | Description |
---|---|
|
Invalid private key format. Expected DER. |
|
Invalid private key type. Expected ED25519. |
Class Implementation
The Hiero DID SDK provides the Signer
class within its signer-internal
package. For further details, refer to the @hiero-did-sdk-js/signer-internal
package documentation.