Skip to main content

Secp256r1PrivateKey

Namespace: IotaSdk

public class Secp256r1PrivateKey : ISecp256r1PrivateKey, System.IEquatable`1[[IotaSdk.Secp256r1PrivateKey, IotaSdk, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.IDisposable

Inheritance ObjectSecp256r1PrivateKey
Implements ISecp256r1PrivateKey, IEquatable<Secp256r1PrivateKey>, IDisposable
Attributes NullableContextAttribute, NullableAttribute

Constructors

Secp256r1PrivateKey(UInt64)

public Secp256r1PrivateKey(ulong pointer)

Parameters

pointer UInt64

Secp256r1PrivateKey(Byte[])

public Secp256r1PrivateKey(Byte[] bytes)

Parameters

bytes Byte[]

Methods

Destroy()

public void Destroy()

Dispose()

public void Dispose()

PublicKey()

Get the public key corresponding to this private key.

public Secp256r1PublicKey PublicKey()

Returns

Secp256r1PublicKey

Scheme()

public SignatureScheme Scheme()

Returns

SignatureScheme

SignPersonalMessage(PersonalMessage)

Sign a personal message and return a UserSignature.

public UserSignature SignPersonalMessage(PersonalMessage message)

Parameters

message PersonalMessage

Returns

UserSignature

Exceptions

SdkFfiException

SignTransaction(Transaction)

Sign a transaction and return a UserSignature.

public UserSignature SignTransaction(Transaction transaction)

Parameters

transaction Transaction

Returns

UserSignature

Exceptions

SdkFfiException

ToBech32()

Encode this private key as flag || privkey in Bech32 starting with "iotaprivkey" to a string.

public string ToBech32()

Returns

String

Exceptions

SdkFfiException

ToBytes()

Serialize this private key to bytes.

public Byte[] ToBytes()

Returns

Byte[]

ToDer()

Serialize this private key as DER-encoded PKCS#8

public Byte[] ToDer()

Returns

Byte[]

Exceptions

SdkFfiException

ToPem()

Serialize this private key as PEM-encoded PKCS#8

public string ToPem()

Returns

String

Exceptions

SdkFfiException

TrySign(Byte[])

Sign a message and return a Secp256r1Signature.

public Secp256r1Signature TrySign(Byte[] message)

Parameters

message Byte[]

Returns

Secp256r1Signature

Exceptions

SdkFfiException

TrySignSimple(Byte[])

Sign a message and return a SimpleSignature.

public SimpleSignature TrySignSimple(Byte[] message)

Parameters

message Byte[]

Returns

SimpleSignature

Exceptions

SdkFfiException

TrySignUser(Byte[])

Sign a message and return a UserSignature.

public UserSignature TrySignUser(Byte[] message)

Parameters

message Byte[]

Returns

UserSignature

Exceptions

SdkFfiException

VerifyingKey()

public Secp256r1VerifyingKey VerifyingKey()

Returns

Secp256r1VerifyingKey

Equals(Secp256r1PrivateKey)

public bool Equals(Secp256r1PrivateKey? other)

Parameters

other Secp256r1PrivateKey?

Returns

Boolean

Equals(Object)

public override bool Equals(object? obj)

Parameters

obj Object?

Returns

Boolean

FromBech32(String)

Decode a private key from flag || privkey in Bech32 starting with "iotaprivkey".

public static Secp256r1PrivateKey FromBech32(string value)

Parameters

value String

Returns

Secp256r1PrivateKey

Exceptions

SdkFfiException

FromDer(Byte[])

Deserialize PKCS#8 private key from ASN.1 DER-encoded data (binary format).

public static Secp256r1PrivateKey FromDer(Byte[] bytes)

Parameters

bytes Byte[]

Returns

Secp256r1PrivateKey

Exceptions

SdkFfiException

FromMnemonic(String, UInt64, String)

Construct the private key from a mnemonic phrase

public static Secp256r1PrivateKey FromMnemonic(string phrase, ulong accountIndex = 0, string password = "")

Parameters

phrase String

accountIndex UInt64

password String

Returns

Secp256r1PrivateKey

Exceptions

SdkFfiException

FromMnemonicWithPath(String, String, String)

Create an instance from a mnemonic phrase and a derivation path like "m/74'/4218'/0'/0/0"

public static Secp256r1PrivateKey FromMnemonicWithPath(string phrase, string path, string password = "")

Parameters

phrase String

path String

password String

Returns

Secp256r1PrivateKey

Exceptions

SdkFfiException

FromPem(String)

Deserialize PKCS#8-encoded private key from PEM.

public static Secp256r1PrivateKey FromPem(string s)

Parameters

s String

Returns

Secp256r1PrivateKey

Exceptions

SdkFfiException

Random()

Generate a new random Secp256r1PrivateKey

public static Secp256r1PrivateKey Random()

Returns

Secp256r1PrivateKey