Platforms to show: All Mac Windows Linux Cross-Platform

Back to ECKeyMBS class.

ECKeyMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The constructor.

ECKeyMBS.Copy as ECKeyMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a copy of the key.

ECKeyMBS.ES256Sign(Data as MemoryBlock) as String   New in 25.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 25.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Signs the given data.

We perform a hash with SHA256 of the data and sign the hash.

Returns the signature as string on success.

See also:

ECKeyMBS.ES256Sign(Data as String) as String   New in 25.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 25.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Signs the given data.
Example
Var n As Integer = ECKeyMBS.CurveNameToID("P-256" )
Var e As ECKeyMBS = ECKeyMBS.KeyByCurveName(n)
var description as string = e.Description

Var DataToSign As String = "Hello World"

Var SignatureData As String = e.ES256Sign(DataToSign)
Var ok As Boolean = e.ES256Verify(SignatureData, DataToSign)

Break // ok should be true

We perform a hash with SHA256 of the data and sign the hash.

Returns the signature as string on success.

See also:

ECKeyMBS.ES256Verify(SignatureData as MemoryBlock, Data as MemoryBlock) as Boolean   New in 25.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 25.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Verifies the digital signature.

We perform a hash with SHA256 of the data and verify the result.

Returns true on success. Returns false if data, signature and public key don't belong together.

See also:

ECKeyMBS.ES256Verify(SignatureData as String, Data as String) as Boolean   New in 25.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 25.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Verifies the digital signature.

We perform a hash with SHA256 of the data and verify the result.

Returns true on success. Returns false if data, signature and public key don't belong together.

See also:

ECKeyMBS.Generate as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Generates new key and stores in the current object.

Returns true on success or false on failure.

ECKeyMBS.GetPrivateKey(Hex as Boolean) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries priv key.
Example
// make a key
Const NID_secp192k1 = 711
Var e As ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)

// show private key
MsgBox e.GetPrivateKey(True)+_
EndOfLine+_
e.GetPrivateKey(False)

The private key is a big number, which can be returned as decimal or hexadecimal value.

ECKeyMBS.GetPublicKey(byref x as String, byref y as String, Hex as Boolean) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries X and Y of public key.
Example
// make a key
Const NID_secp192k1 = 711
Var e As ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)

// show public key
Var x,y as string
If e.GetPublicKey(x, y, False) Then
MsgBox x+EndOfLine+y
End If

The public key is made up with two big numbers, which can be returned as decimal or hexadecimal value.
Returns true on success or false on failure.

ECKeyMBS.GetPublicKeyPoint as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries Public key as hex string.
Example
// make a key
Const NID_secp192k1 = 711
Var e As ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)

// show public key
msgbox e.GetPublicKeyPoint

Can be queried to save/send and later be assigned with SetPublicKeyPoint.

ECKeyMBS.PrivateKey as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries the priv key.
Example
const NID_secp192k1 = 711
Var key as ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)
Var Data as string = key.PrivateKey
MsgBox EncodeBase64(data)

ECKeyMBS.PublicKey as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries the public key.
Example
const NID_secp192k1 = 711
Var key as ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)
Var Data as string = key.PublicKey
MsgBox EncodeBase64(data)

ECKeyMBS.SetPrivateKey(Value as String, Hex as Boolean) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the key.
Example
// make a key
Const NID_secp192k1 = 711
Var e As ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)

MsgBox e.Description

// get hex
Var pubk As String = e.GetPublicKeyPoint
Var priv As String = e.GetPrivateKey(False)


// make new empty key and put in the data
Var ee As ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1, False)

If ee.SetPrivateKey(priv, False) Then
If ee.SetPublicKeyPoint(pubk) Then
MsgBox ee.Description
Else
Break // failed?
End If
Else
Break // failed?
End If

Returns true on success or false on failure.

ECKeyMBS.SetPublicKey(x as String, y as String, Hex as Boolean) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets X and Y of public key.
Example
// make a key
Const NID_secp192k1 = 711
Var e As ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)

MsgBox e.Description

// get hex
Var pubk As String = e.GetPublicKeyPoint
Var priv As String = e.GetPrivateKey(False)


// make new empty key and put in the data
Var ee As ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1, False)

If ee.SetPrivateKey(priv, False) Then
If ee.SetPublicKeyPoint(pubk) Then
MsgBox ee.Description
Else
Break // failed?
End If
Else
Break // failed?
End If

Returns true on success or false on failure.

ECKeyMBS.SetPublicKeyPoint(Value as String) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets public key.

Returns true on success or false on failure.

ECKeyMBS.Sign(Data as MemoryBlock) as String   New in 25.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 25.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Signs the given data.

We highly recommend to use a hash like SHA-512 to preprocess the data.
Returns the signature as string on success.

See also:

ECKeyMBS.Sign(Data as String) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Signs the given data.
Example
const NID_secp192k1 = 711
Var key as ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)
Var text as string = "Hello World"
Var data as string = SHA512MBS.Hash(text)
Var sig as string = key.Sign(data)

if key.Verify(data, sig) then
MsgBox "Signature ok"
end if

We highly recommend to use a hash like SHA-512 to preprocess the data.
Returns the signature as string on success.

See also:

ECKeyMBS.Verify(SignatureData as MemoryBlock, Data as MemoryBlock) as Boolean   New in 25.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 25.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Verifies the digital signature.

Returns true on success. Returns false if data, signature and public key don't belong together.
We highly recommend to use a hash like SHA-512 to preprocess the data.

See also:

ECKeyMBS.Verify(SignatureData as String, Data as String) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Verifies the digital signature.
Example
const NID_secp192k1 = 711
Var key as ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1)
Var text as string = "Hello World"
Var data as string = SHA512MBS.Hash(text)
Var sig as string = key.Sign(data)

if key.Verify(data, sig) then
MsgBox "Signature ok"
end if

Returns true on success. Returns false if data, signature and public key don't belong together.
We highly recommend to use a hash like SHA-512 to preprocess the data.

See also:

The items on this page are in the following plugins: MBS Encryption Plugin.


The biggest plugin in space...