Secp256k1PrivateKey
Namespace: IotaSdk
public class Secp256k1PrivateKey : ISecp256k1PrivateKey, System.IEquatable`1[[IotaSdk.Secp256k1PrivateKey, IotaSdk, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.IDisposable
Inheritance Object → Secp256k1PrivateKey
Implements ISecp256k1PrivateKey, IEquatable<Secp256k1PrivateKey>, IDisposable
Attributes NullableContextAttribute, NullableAttribute
Constructors
Secp256k1PrivateKey(UInt64)
public Secp256k1PrivateKey(ulong pointer)
Parameters
pointer UInt64
Secp256k1PrivateKey(Byte[])
public Secp256k1PrivateKey(Byte[] bytes)
Parameters
bytes Byte[]
Methods
Destroy()
public void Destroy()
Dispose()
public void Dispose()
PublicKey()
public Secp256k1PublicKey PublicKey()
Returns
Scheme()
public SignatureScheme Scheme()
Returns
SignPersonalMessage(PersonalMessage)
Sign a personal message and return a UserSignature.
public UserSignature SignPersonalMessage(PersonalMessage message)
Parameters
message PersonalMessage
Returns
Exceptions
SignTransaction(Transaction)
Sign a transaction and return a UserSignature.
public UserSignature SignTransaction(Transaction transaction)
Parameters
transaction Transaction
Returns
Exceptions
ToBech32()
Encode this private key as flag || privkey in Bech32 starting with
"iotaprivkey" to a string.
public string ToBech32()
Returns
Exceptions
ToBytes()
Serialize this private key to bytes.
public Byte[] ToBytes()
Returns
ToDer()
Serialize this private key as DER-encoded PKCS#8
public Byte[] ToDer()
Returns
Exceptions
ToPem()
Serialize this private key as PEM-encoded PKCS#8
public string ToPem()
Returns
Exceptions
TrySign(Byte[])
public Secp256k1Signature TrySign(Byte[] message)
Parameters
message Byte[]
Returns
Exceptions
TrySignSimple(Byte[])
public SimpleSignature TrySignSimple(Byte[] message)
Parameters
message Byte[]
Returns
Exceptions
TrySignUser(Byte[])
public UserSignature TrySignUser(Byte[] message)
Parameters
message Byte[]
Returns
Exceptions
VerifyingKey()
public Secp256k1VerifyingKey VerifyingKey()
Returns
Equals(Secp256k1PrivateKey)
public bool Equals(Secp256k1PrivateKey? other)
Parameters
other Secp256k1PrivateKey?
Returns
Equals(Object)
public override bool Equals(object? obj)
Parameters
obj Object?
Returns
FromBech32(String)
Decode a private key from flag || privkey in Bech32 starting with
"iotaprivkey".
public static Secp256k1PrivateKey FromBech32(string value)
Parameters
value String
Returns
Exceptions
FromDer(Byte[])
Deserialize PKCS#8 private key from ASN.1 DER-encoded data (binary format).
public static Secp256k1PrivateKey FromDer(Byte[] bytes)
Parameters
bytes Byte[]
Returns
Exceptions
FromMnemonic(String, UInt64, String)
Construct the private key from a mnemonic phrase
public static Secp256k1PrivateKey FromMnemonic(string phrase, ulong accountIndex = 0, string password = "")
Parameters
phrase String
accountIndex UInt64
password String
Returns
Exceptions
FromMnemonicWithPath(String, String, String)
Create an instance from a mnemonic phrase and a derivation path like
"m/54'/4218'/0'/0/0"
public static Secp256k1PrivateKey FromMnemonicWithPath(string phrase, string path, string password = "")
Parameters
phrase String
path String
password String
Returns
Exceptions
FromPem(String)
Deserialize PKCS#8-encoded private key from PEM.
public static Secp256k1PrivateKey FromPem(string s)
Parameters
s String
Returns
Exceptions
Random()
public static Secp256k1PrivateKey Random()