convertKetToBase64 | ||||||||
convertKetToBase64(key: string)
|
||||||||
Converts an RSA key to a base64-encoded string. This function removes any leading spaces from each line of the key and then encodes it to base64 format.
Parameters :
Returns :
string
The base64-encoded version of the RSA key. |
createPrivateAndPublicKeys | ||||||||||
createPrivateAndPublicKeys(modulusLength: number)
|
||||||||||
Generates a pair of RSA private and public keys with the specified modulus length. If the
Parameters :
Returns :
returnCreateKeys
An object containing the generated RSA public and private keys in PEM format. |
decrypt | ||||||||
decrypt(args: parametersOfDecryptPublic)
|
||||||||
Decrypts a base64-encoded string using an RSA public key. The function first decodes the provided RSA public key and the base64-encoded text, then decrypts the text using the RSA public key.
Parameters :
Returns :
string
The decrypted string in UTF-8 format. |
decryptStringWithRsaPrivateKey | ||||||||
decryptStringWithRsaPrivateKey(args: parametersOfDecrypt)
|
||||||||
Decrypts a base64-encoded string using an RSA private key. This function decodes the provided RSA private key, then uses it to decrypt the base64-encoded string.
Parameters :
Returns :
string
The decrypted string in UTF-8 format. |
encrypt | ||||||||
encrypt(args: parametersOfEncryptPrivate)
|
||||||||
Encrypts a string using an RSA private key. This function encodes the provided RSA private key, converts the input text to a buffer, and encrypts it using the private key. The result is returned as a base64-encoded string.
Parameters :
Returns :
string
The encrypted string in base64 format. |
encryptStringWithRsaPublicKey | ||||||||
encryptStringWithRsaPublicKey(args: parametersOfEncrypt)
|
||||||||
Encrypts a string using an RSA public key. This function decodes the provided RSA public key, converts the input text into a buffer, and encrypts it using the public key. The encrypted result is returned as a base64-encoded string.
Parameters :
Returns :
string
The encrypted string in base64 format. |