Show / Hide Table of Contents

Class Endorsement

Represents the key signing requirements for various transactions available within the network.

Inheritance
Object
Endorsement
Implements
IEquatable<Endorsement>
Inherited Members
Object.Equals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Hashgraph
Assembly: Hashgraph.dll
Syntax
public sealed class Endorsement : IEquatable<Endorsement>

Constructors

| Improve this Doc View Source

Endorsement(Endorsement[])

Create a M of M requied list of endorsements. All listed endorsements must be fulfilled to fulfill this endorsement.

Declaration
public Endorsement(params Endorsement[] endorsements)
Parameters
Type Name Description
Endorsement[] endorsements

A list of endorsements that must be fullfilled, may be a mix of individual public keys or additional sub-lists of individual keys.

Exceptions
Type Condition
ArgumentNullException

if endorsements is null

| Improve this Doc View Source

Endorsement(KeyType, ReadOnlyMemory<Byte>)

Creates an endorsement representing a single key of a valid type. Will accept Ed25519, RSA3072, ECDSA381 and Smart Contract ID. Presently the only key implemented by the network Ed25519 and validity of this key is checked upon creation of this object.

Declaration
public Endorsement(KeyType type, ReadOnlyMemory<byte> publicKey)
Parameters
Type Name Description
KeyType type

The type of key the bytes represent.

ReadOnlyMemory<Byte> publicKey

The bytes for the public key.

Exceptions
Type Condition
ArgumentOutOfRangeException

If type passed into the constructor was not a valid single key type. Or, for an Ed25519 key that is not recognizable from supplied bytes.

| Improve this Doc View Source

Endorsement(ReadOnlyMemory<Byte>)

Convenience constructor creating an Ed25519 public key endorsement. This is the most common key format for the network.

Declaration
public Endorsement(ReadOnlyMemory<byte> publicKey)
Parameters
Type Name Description
ReadOnlyMemory<Byte> publicKey

Bytes representing a public Ed25519 key.

| Improve this Doc View Source

Endorsement(UInt32, Endorsement[])

Create a N of M required list of endorsements. Only

requiredCount
number of listed endorsements must

be fulfilled to fulfill this endorsement.

Declaration
public Endorsement(uint requiredCount, params Endorsement[] endorsements)
Parameters
Type Name Description
UInt32 requiredCount

The number of child endorsements that must be fulfilled in order to fulfill this endorsement.

Endorsement[] endorsements

A list of candidate endorsements, may be a mix of individual public keys or additional sub-lists of individual keys.

Exceptions
Type Condition
ArgumentNullException

if endorsements is null

ArgumentOutOfRangeException

if the required amount is negative greater than tne number of endorsements

Properties

| Improve this Doc View Source

List

Returns a list of child endorsements identified by this endorsement (of list type). If the endorsement is not of a list type, the list will be empty.

Declaration
public Endorsement[] List { get; }
Property Value
Type Description
Endorsement[]
| Improve this Doc View Source

None

A special designation of an endorsement key that can't be created. It represents an "empty" list of keys, which the network will intrepret as "clear all keys" from this setting (typically the value null is intepreted as "make no change"). In this way, it is possible to change a topic from mutable (which has an Administrator endorsement) to imutable (having no Administrator endorsement).

Declaration
public static Endorsement None { get; }
Property Value
Type Description
Endorsement
| Improve this Doc View Source

PublicKey

The value of the public key held by this endorsement if it is of a key type. If it is a list type, the value returned will be

Empty
.

Declaration
public ReadOnlyMemory<byte> PublicKey { get; }
Property Value
Type Description
ReadOnlyMemory<Byte>
| Improve this Doc View Source

RequiredCount

When this endorsement contains a list of child endorsements, this represents the number of child endorsements that must be fulfilled in order to consider this endorsement fulfilled.

Declaration
public uint RequiredCount { get; }
Property Value
Type Description
UInt32
| Improve this Doc View Source

Type

The type of endorsement this object is. It either contains a representation of a public key or a list of child endorsements with a not of how many are requrired to be fullfilled for this endorsement to be fulfilled.

Declaration
public KeyType Type { get; }
Property Value
Type Description
KeyType

Methods

| Improve this Doc View Source

Equals(Endorsement)

Equality implementation.

Declaration
public bool Equals(Endorsement other)
Parameters
Type Name Description
Endorsement other

The other

Endorsement
object to compare.

Returns
Type Description
Boolean

True if public key layout and requirements are equivalent to the other

Endorsement
object.

| Improve this Doc View Source

Equals(Object)

Equality implementation.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
Object obj

The other

Endorsement
object to compare (if it is an
Endorsement
).

Returns
Type Description
Boolean

If the other object is an Endorsement, then

True
if key requirements are identical to the other

Endorsements
object, otherwise
False
.
Overrides
Object.Equals(Object)
| Improve this Doc View Source

GetHashCode()

Equality implementation.

Declaration
public override int GetHashCode()
Returns
Type Description
Int32

A unique hash of the contents of this

Endorsement
object. Only consistent within the current instance of the application process.

Overrides
Object.GetHashCode()

Operators

| Improve this Doc View Source

Equality(Endorsement, Endorsement)

Equals implementation.

Declaration
public static bool operator ==(Endorsement left, Endorsement right)
Parameters
Type Name Description
Endorsement left

Left hand

Endorsement
argument.

Endorsement right

Right hand

Endorsement
argument.

Returns
Type Description
Boolean

True if Key requirements are identical within each

Endorsement
objects.

| Improve this Doc View Source

Implicit(ReadOnlyMemory<Byte> to Endorsement)

Implicit constructor converting an Ed25519 public key represented in bytes into an

Endorsement
representing an Ed25519 key. This convenience operator exists becuase Ed25519 keys are the most prominent in the system at the moment.

Declaration
public static implicit operator Endorsement(ReadOnlyMemory<byte> publicKey)
Parameters
Type Name Description
ReadOnlyMemory<Byte> publicKey

Bytes representing a public Ed25519 key.

Returns
Type Description
Endorsement
Exceptions
Type Condition
ArgumentOutOfRangeException

If

publicKey
is not recognizable as an Ed25519 public key.

| Improve this Doc View Source

Inequality(Endorsement, Endorsement)

Not equals implementation.

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

Left hand

Endorsement
argument.

Endorsement right

Right hand

Endorsement
argument.

Returns
Type Description
Boolean
False
if the Key requirements are identical

within each

Endorsement
object.

True
if they are not identical.

Implements

System.IEquatable<T>
  • Improve this Doc
  • View Source
In This Article
Back to top .NET Client Library for Hedera Hashgraph