reckfellENGINE

CryptoKey

A cryptographic key (RSA or elliptic-curve).

On this page
class CryptoKeyReckfellSharpInherits Resource

A cryptographic key (RSA or elliptic-curve).

The CryptoKey class represents a cryptographic key. Keys can be loaded and saved like any other Resource. They can be used to generate a self-signed X509Certificate via Crypto.GenerateSelfSignedCertificate and as private key in StreamPeerTls.AcceptStream along with the appropriate certificate.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

CryptoKeyConstructor
# CryptoKey
C#
public CryptoKey();

Methods5

IsPublicOnlybool
# IsPublicOnly
C#
public bool IsPublicOnly();

Returns true if this CryptoKey only has the public part, and not the private one.

Returns bool
LoadError
# Load
C#
public Error Load(string path, bool publicOnly = false);

Loads a key from path. If public_only is true, only the public key will be loaded. Note: path should be a ".pub" file if public_only is true, a ".key" file otherwise.

Parameters
NameTypeDefault
pathstring—
publicOnlyboolfalse
Returns Error
LoadFromStringError
# LoadFromString
C#
public Error LoadFromString(string stringKey, bool publicOnly = false);

Loads a key from the given string_key. If public_only is true, only the public key will be loaded.

Parameters
NameTypeDefault
stringKeystring—
publicOnlyboolfalse
Returns Error
SaveError
# Save
C#
public Error Save(string path, bool publicOnly = false);

Saves a key to the given path. If public_only is true, only the public key will be saved. Note: path should be a ".pub" file if public_only is true, a ".key" file otherwise.

Parameters
NameTypeDefault
pathstring—
publicOnlyboolfalse
Returns Error
SaveToStringstring
# SaveToString
C#
public string SaveToString(bool publicOnly = false);

Returns a string containing the key in PEM format. If public_only is true, only the public key will be included.

Parameters
NameTypeDefault
publicOnlyboolfalse
Returns string
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.