Show / Hide Table of Contents

Class Signatory

Represents a keyholder or group of keyholders that can sign a transaction for crypto transfer to support file creation, contract creation and execution or pay for consensus services among other network tasks.

Inheritance
object
Signatory
Implements
IEquatable<Signatory>
Inherited Members
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public sealed class Signatory : IEquatable<Signatory>
Remarks
A 
Signatory

is presently created with a pre-existing Ed25519 private key or a callback action having the information necessary to successfully sign the transaction as described by its matching Endorsement requirements. RSA-3072, ECDSA and

Contract

signatures are not natively supported through the

Signatory

at this time but can be achieved through the callback functionality.

Constructors

| Edit this page View Source

Signatory(KeyType, ReadOnlyMemory<byte>)

Create a signatory having a private key of the specified type.

Declaration
public Signatory(KeyType type, ReadOnlyMemory<byte> privateKey)
Parameters
Type Name Description
KeyType type
The type of private key this 
Signatory

should use to sign transactions.

ReadOnlyMemory<byte> privateKey

The bytes of a private key corresponding to the specified type.

Remarks

At this time, the library only supports Ed25519 and ECDSA Secp256k1 key types.

Exceptions
Type Condition
ArgumentOutOfRangeException

If any key type other than Ed25519 or ECDSA Secp256k1 is used.

| Edit this page View Source

Signatory(params Signatory[])

Create a signatory that is a combination of a number of other signatories. When this signatory is called to sign a transaction it will in turn ask all the child signatories in turn to sign the given transaction.

Declaration
public Signatory(params Signatory[] signatories)
Parameters
Type Name Description
Signatory[] signatories

One or more signatories that when combined can form a multi key signature for the transaction.

| Edit this page View Source

Signatory(Func<IInvoice, Task>)

Create a Signatory invoking the given async callback function
when asked to sign a transaction.  The 
Signatory
will pass an instance of an <xref href="Hiero.IInvoice" data-throw-if-not-resolved="false"></xref> containing 
details of the transaction to sign when needed.  The callback 
function may add as many signatures as necessary to properly 
sign the  transaction.
Declaration
public Signatory(Func<IInvoice, Task> signingCallback)
Parameters
Type Name Description
Func<IInvoice, Task> signingCallback

An async callback method that is invoked when the library asks this Signatory to sign a transaction.

Remarks

Note: For a single transaction this method MAY BE CALLED TWICE in the event the library is being asked to retrieve a record as a part of the request. This is because retrieving a record of a transaction requires a separate payment. So, if this Signatory is directly attached to the root IConsensusContext it will be used to sign the request to retrieve the record (since this will typically represent the Payer's signature for the transaction).

| Edit this page View Source

Signatory(ReadOnlyMemory<byte>)

Create a signatory with a private Ed25519 key. When transactions are signed, this signatory will automatically sign the transaction with this private key.

Declaration
public Signatory(ReadOnlyMemory<byte> privateKey)
Parameters
Type Name Description
ReadOnlyMemory<byte> privateKey
Bytes representing an Ed25519 private key signing transactions.  
It is expected to be 48 bytes in length, prefixed with 

<pre><code class="lang-csharp">0x302e020100300506032b6570</code></pre>

.

Methods

| Edit this page View Source

Equals(Signatory?)

Equality implementation.

Declaration
public bool Equals(Signatory? other)
Parameters
Type Name Description
Signatory other
The other 
Signatory

object to compare.

Returns
Type Description
bool
True if public key layout and requirements are equivalent to the 
other 
Signatory

object.

| Edit this page View Source

Equals(object?)

Equality implementation.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
object obj
The other 
Signatory

object to compare (if it is an

Signatory

).

Returns
Type Description
bool
If the other object is an Signatory, then 
True
if key requirements are identical to the other 

<pre><code class="lang-csharp">Signatories</code></pre>

object, otherwise

<pre><code class="lang-csharp">False</code></pre>

.

Overrides
object.Equals(object)
| Edit this page View Source

GetEndorsements()

Retrieves a list of Endorsement (Public Keys) held internally by this Signatory (and/or its child signatories). At this time only Endorsements backed by Ed25519 and ECDSA keys are exported. If this signatory represents a Scheduled marker or Contract, the list returned will be empty.

Declaration
public IReadOnlyList<Endorsement> GetEndorsements()
Returns
Type Description
IReadOnlyList<Endorsement>

A collection of Ed25519 and/or ECDSA Endorsements, can be an empty list if none exist.

| Edit this page View Source

GetHashCode()

Equality implementation.

Declaration
public override int GetHashCode()
Returns
Type Description
int
A unique hash of the contents of this 
Signatory
object.  Only consistent within the current instance of 
the application process.
Overrides
object.GetHashCode()

Operators

| Edit this page View Source

operator ==(Signatory, Signatory)

Equals implementation.

Declaration
public static bool operator ==(Signatory left, Signatory right)
Parameters
Type Name Description
Signatory left
Left hand 
Signatory

argument.

Signatory right
Right hand 
Signatory

argument.

Returns
Type Description
bool
True if Key requirements are identical 
within each 
Signatory

objects.

| Edit this page View Source

implicit operator Signatory(Func<IInvoice, Task>)

Convenience implicit cast for creating a 
Signatory
directly from a 
Func<IInvoice, Task> signingCallback
callback
method.
Declaration
public static implicit operator Signatory(Func<IInvoice, Task> signingCallback)
Parameters
Type Name Description
Func<IInvoice, Task> signingCallback

An async callback method that is invoked when the library asks this Signatory to sign a transaction.

Returns
Type Description
Signatory
| Edit this page View Source

implicit operator Signatory(ReadOnlyMemory<byte>)

Convenience implicit cast for creating a 
Signatory
directly from an Ed25519 private key.
Declaration
public static implicit operator Signatory(ReadOnlyMemory<byte> privateKey)
Parameters
Type Name Description
ReadOnlyMemory<byte> privateKey
Bytes representing an Ed25519 private key signing transactions.  
It is expected to be 48 bytes in length, prefixed with 

<pre><code class="lang-csharp">0x302e020100300506032b6570</code></pre>

.

Returns
Type Description
Signatory
| Edit this page View Source

operator !=(Signatory, Signatory)

Not equals implementation.

Declaration
public static bool operator !=(Signatory left, Signatory right)
Parameters
Type Name Description
Signatory left
Left hand 
Signatory

argument.

Signatory right
Right hand 
Signatory

argument.

Returns
Type Description
bool
False

if the Key requirements are identical within each

Signatory

object.

<pre><code class="lang-csharp">True</code></pre>

if they are not identical.

Implements

IEquatable<T>
  • Edit this page
  • View Source
In this article
Back to top .NET Client Library for Hiero Network and Hedera Hashgraph