Skip to main content

PublicKey

Namespace: IotaSdk

Enum of valid public keys for the signature schemes supported by IOTA.

BCS

The BCS serialized form of this type is specified in bcs-schema.abnf.

The gap in the flag values of the public-key rule is intentional, as not all signature schemes support public keys.

There is also a base64 encoding for this type defined as:

base64-public-key = string ; which is valid base64 encoded
; and the decoded bytes are defined
; by flagged-public-key
flagged-public-key = (ed25519-flag ed25519-public-key) /
(secp256k1-flag secp256k1-public-key) /
(secp256r1-flag secp256r1-public-key) /
(passkey-flag passkey-public-key)
public class PublicKey : IPublicKey, System.IEquatable`1[[IotaSdk.PublicKey, IotaSdk, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.IDisposable

Inheritance Object → PublicKey
Implements IPublicKey, IEquatable<PublicKey>, IDisposable
Attributes NullableContextAttribute, NullableAttribute

Constructors​

PublicKey(UInt64)​

public PublicKey(ulong pointer)

Parameters​

pointer UInt64

Methods​

Destroy()​

public void Destroy()

Dispose()​

public void Dispose()

ToBcs()​

Convert this type to BCS encoded bytes.

public Byte[] ToBcs()

Returns​

Byte[]

Exceptions​

SdkFfiException

ToDisplayString()​

Render this type as human-readable text.

Some types also print this through the binding's native string conversion; this method is the spelling every object type has.

The layout is meant for reading and can change between releases. Use the JSON or BCS conversions for output that gets parsed.

public string ToDisplayString()

Returns​

String

ToJson()​

Convert this type to a JSON encoded string.

public string ToJson()

Returns​

String

Exceptions​

SdkFfiException

AsEd25519()​

public Ed25519PublicKey AsEd25519()

Returns​

Ed25519PublicKey

AsOptEd25519()​

public Ed25519PublicKey? AsOptEd25519()

Returns​

Ed25519PublicKey?

AsOptPasskey()​

public PasskeyPublicKey? AsOptPasskey()

Returns​

PasskeyPublicKey?

AsOptSecp256k1()​

public Secp256k1PublicKey? AsOptSecp256k1()

Returns​

Secp256k1PublicKey?

AsOptSecp256r1()​

public Secp256r1PublicKey? AsOptSecp256r1()

Returns​

Secp256r1PublicKey?

AsPasskey()​

public PasskeyPublicKey AsPasskey()

Returns​

PasskeyPublicKey

AsSecp256k1()​

public Secp256k1PublicKey AsSecp256k1()

Returns​

Secp256k1PublicKey

AsSecp256r1()​

public Secp256r1PublicKey AsSecp256r1()

Returns​

Secp256r1PublicKey

IsEd25519()​

public bool IsEd25519()

Returns​

Boolean

IsPasskey()​

public bool IsPasskey()

Returns​

Boolean

IsSecp256k1()​

public bool IsSecp256k1()

Returns​

Boolean

IsSecp256r1()​

public bool IsSecp256r1()

Returns​

Boolean

Scheme()​

public SignatureScheme Scheme()

Returns​

SignatureScheme

ToBase64()​

Encode this public key as a base64 string of its scheme-flagged byte representation

public string ToBase64()

Returns​

String

Equals(PublicKey)​

public bool Equals(PublicKey? other)

Parameters​

other PublicKey?

Returns​

Boolean

Equals(Object)​

public override bool Equals(object? obj)

Parameters​

obj Object?

Returns​

Boolean

FromBcs(Byte[])​

Create this type from BCS encoded bytes.

public static PublicKey FromBcs(Byte[] bcs)

Parameters​

bcs Byte[]

Returns​

PublicKey

Exceptions​

SdkFfiException

FromJson(String)​

Create this type from a JSON encoded string.

public static PublicKey FromJson(string json)

Parameters​

json String

Returns​

PublicKey

Exceptions​

SdkFfiException

FromBase64(String)​

Decode a public key from a base64 string of its scheme-flagged byte representation

public static PublicKey FromBase64(string s)

Parameters​

s String

Returns​

PublicKey

Exceptions​

SdkFfiException