AsymmetricGenerateKey
PowerScript function
Description
Generates a secret key for asymmetric algorithm.
Applies to
CrypterObject objects
Syntax
|
1 |
crypter.AsymmetricGenerateKey ( algorithm, len, privKey, pubKey) |
|
Argument |
Description |
|---|---|
|
crypter |
The name of the CrypterObject object |
|
algorithm |
A value of the AsymmetricAlgorithm enumerated type that Values are:
|
|
len |
An integer specifying the key length. Recommended key |
|
privKey |
A blob receiving the private key. |
|
pubKey |
A blob receiving the public key. |
Return value
Integer. Returns 1 if it succeeds and -1 if it failed. If any
argument’s value is null, the method returns null. If an error occurs,
throw the exception.
Examples
This statement generates a public key and a private key.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Integer li_return Blob lblb_privKey Blob lblb_pubKey CrypterObject lnv_CrypterObject lnv_CrypterObject = Create CrypterObject // Generate the key li_return = lnv_CrypterObject.AsymmetricGenerateKey(RSA!, 1024, lblb_privKey, lblb_pubKey) if li_return = 1 then messagebox("Success", "Key is generated successfully!") else messagebox("Error", "Failed to generate the key!") end if |
See also