Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

CryptoRSA Methods

Daniel Linsley edited this page May 15, 2017 · 3 revisions

RSA

Methods to encrypt / decrypt / sign / verify data with RSA style encryption.

CryptoRSA.createSignature

Creates a RSA signature Base64 encoded.

Signature

String CryptoRSA.createSignature(String key, String dataB64)

Parameters

Name Type Description
key String PEM encoded Private Key
dataB64 String Base64 encoded message to sign

CryptoRSA.decrypt

Asymmetric RSA decryption. Result is Base64 encoded to support binary data. If you are expecting clear text from the decryption, use CryptoEncoding.base64Decode on the result.

Signature

String CryptoRSA.decrypt(String key, String encryptedB64)

Parameters

Name Type Description
key String PEM encoded Private Key
encryptedB64 String Base64 encoded encrypted data

CryptoRSA.encrypt

Asymmetric RSA encryption. Result is Base64 encoded.

Signature

String CryptoRSA.encrypt(String key, String dataB64)

Parameters

Name Type Description
key String PEM encoded Public or Private Key
dataB64 String Base64 encoded data. Supports binary data.

CryptoRSA.verifySignature

Verifies a RSA signature. Returns true on successful validation.

Signature

boolean CryptoRSA.verifySignature(String key, String dataB64, String signatureB64)

Parameters

Name Type Description
key String PEM encoded Public or Private Key
dataB64 String Base64 encoded message that was signed
signatureB64 String Base64 encoded RSA signature to verify

Clone this wiki locally