SAP Help Home SAP Intelligent RPA Help Portal SAP Intelligent RPA Community

Module - Cryptography collection

This library contains cryptography algorithms

Activities

Cipher

Encrypt a value using a key local to the user session.


Technical Name Type Minimal Agent Version
cipher synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
text string mandatory Clear text value.
key string optional Optional key value used to encrypt.

Output Parameters:

Name Type Description
cipherText string cipherText value.

Sample Code:

let cipherText = irpa_core.cryptography.cipher('login', 'key');



Decipher

Decrypt a value using a key local to the user session.


Technical Name Type Minimal Agent Version
decipher synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
cipherText string mandatory cipherText value.
key string optional Optional key value used to decrypt.

Output Parameters:

Name Type Description
decipherText string Clear value.

Sample Code:

let login = irpa_core.cryptography.decipher(decipherText, 'key');



Create Key Container

Create a key container with a private / public key pair.


Technical Name Type Minimal Agent Version
key.createKeyContainer synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
key irpa_core.keyContainer mandatory Key container.

Output Parameters:

Name Type Description
result boolean True if ok.

Sample Code:

let clientEncryptionCont = { id: 'clientSignatureCont', usage: irpa_core.enums.cryptography.usage.signature }; const result = await irpa_core.cryptography.key.createKeyContainer(clientEncryptionCont);



Delete Key Container

Delete an existing key container.


Technical Name Type Minimal Agent Version
key.deleteKeyContainer synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
key irpa_core.keyContainer mandatory Key container.

Output Parameters:

Name Type Description
result boolean True if ok.

Sample Code:

let clientEncryptionCont = { id: 'clientSignatureCont', usage: irpa_core.enums.cryptography.usage.signature }; const result = await irpa_core.cryptography.key.deleteKeyContainer(clientEncryptionCont);



Get Public Key

Retrieve the public key from an existing key container.


Technical Name Type Minimal Agent Version
key.getPublicKey synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
key irpa_core.keyContainer mandatory Key container.

Output Parameters:

Name Type Description
certificate irpa_core.keyContainer Certificate.

Sample Code:

let res = irpa_core.cryptography.key.getPublicKey(key);



Save Public Key

Store a public key in a key container (without private key).


Technical Name Type Minimal Agent Version
key.savePublicKey synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
key irpa_core.keyContainer mandatory Key container.
publicKey string optional Public key as a binary string.

Output Parameters:

Name Type Description
result string The crypted key.

Sample Code:

const publicKey = '...'; const res = irpa_core.cryptography.key.setPublicKey(key, publicKey);



Decrypt Message (KeyContainer)

Decrypt a message using a certificate or key container.


Technical Name Type Minimal Agent Version
key.decryptMessage synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
input string mandatory Input value.
key irpa_core.keyContainer mandatory Key container.
algorithm irpa_core.enums.cryptography.algorithmEncryption optional Encryption algorithm.
password string optional Optional password value used to encrypt (only usable for a container key, not for a certificate).

Output Parameters:

Name Type Description
result string Decrypted value (null if failed).

Sample Code:

let clientEncryptionCont ={ id: 'clientEncryptionCont', usage: irpa_core.enums.cryptography.usage.signature }; let result = await irpa_core.cryptography.key.encryptMessage('data',clientEncryptionCont, ''); result = await irpa_core.cryptography.key.decryptMessage(result, clientEncryptionCont, '');



Encrypt Message (KeyContainer)

Encrypt a clear file to a cyphered file using a public key from a key container.


Technical Name Type Minimal Agent Version
key.encryptMessage synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
input string mandatory Input value.
key irpa_core.keyContainer mandatory Key container.
algorithm irpa_core.enums.cryptography.algorithmEncryption optional Encryption algorithm.
password string optional Optional password value used to encrypt (only usable for a container key, not for a certificate).

Output Parameters:

Name Type Description
encrypted string Encrypted value (null if failed).

Sample Code:

let clientEncryptionCont = { id: 'clientEncryptionCont', usage: irpa_core.enums.cryptography.usage.signature }; const result = await irpa_core.cryptography.key.encryptMessage('data',clientEncryptionCont,'');



Sign Encrypt Message (KeyContainer)

Sign and encrypt a message using a certificate or key container.


Technical Name Type Minimal Agent Version
key.signEncryptMessage synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
input string mandatory Input value.
key irpa_core.keyContainer mandatory Key container.
algorithm irpa_core.enums.cryptography.algorithmSignature optional Signature algorithm.

Output Parameters:

Name Type Description
signedValue string Signed value (null if failed).

Sample Code:

let clientEncryptionCont = { id: 'clientSignatureCont', usage: irpa_core.enums.cryptography.usage.signature }; let result = await irpa_core.cryptography.key.signEncryptMessage('data',clientEncryptionCont);



Sign Message (KeyContainer)

Sign a message using a certificate or key container.


Technical Name Type Minimal Agent Version
key.signMessage synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
input string mandatory Input value.
key irpa_core.keyContainer mandatory Key container.
algorithm irpa_core.enums.cryptography.algorithmSignature optional Signature algorithm.

Output Parameters:

Name Type Description
signedvalue string Signed value (null if failed).

Sample Code:

let clientEncryptionCont = { id: 'clientSignatureCont', usage: irpa_core.enums.cryptography.usage.signature }; let result = await irpa_core.cryptography.key.signMessage('data',clientEncryptionCont);



Verify Decrypt Message (KeyContainer)

Verify and decrypt a signed message using a certificate or key container.


Technical Name Type Minimal Agent Version
key.verifyDecryptMessage synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
input string mandatory Input value.
key irpa_core.keyContainer mandatory Key container.
algorithm irpa_core.enums.cryptography.algorithmSignature mandatory Signature algorithm.

Output Parameters:

Name Type Description
result string Clear value (null if failed).

Sample Code:

let clientEncryptionCont = { id: 'clientSignatureCont', usage: irpa_core.enums.cryptography.usage.signature }; let result = await irpa_core.cryptography.key.signEncryptMessage('data',clientEncryptionCont); result = await irpa_core.cryptography.key.verifyDecryptMessage(result, clientEncryptionCont);



Verify Message (KeyContainer)

Verify a signed message using a certificate or key container.


Technical Name Type Minimal Agent Version
key.verifyMessage synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
input string mandatory Input value.
signature string mandatory Signature.
key irpa_core.keyContainer mandatory Key container.
algorithm irpa_core.enums.cryptography.algorithmSignature optional Signature algorithm.

Output Parameters:

Name Type Description
result boolean Verification result (false if verification failed).

Sample Code:

let clientEncryptionCont = { id: 'clientSignatureCont', usage: irpa_core.enums.cryptography.usage.signature }; let result = await irpa_core.cryptography.key.signMessage('data',clientEncryptionCont); result = await irpa_core.cryptography.key.verifyMessage('data', result, clientEncryptionCont);



Decrypt Message (Certificate)

Decrypt a message using a certificate or key container.


Technical Name Type Minimal Agent Version
certificate.decryptMessage synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
input string mandatory Input value.
certificate irpa_core.certificateContainer mandatory Certificate.
algorithm irpa_core.enums.cryptography.algorithmEncryption optional Encryption algorithm.

Output Parameters:

Name Type Description
result string Decrypted value (null if failed).

Sample Code:

let clientEncryptionCert = { id: 'clientEncryptionCert', usage: irpa_core.enums.cryptography.usage.encryption, location: irpa_core.enums.cryptography.storeLocation.local, store: 'My', alias: 'CN=irpa_coretClientExchange2' } let result = await irpa_core.cryptography.certificate.encryptMessage('data', clientEncryptionCert); result = await irpa_core.cryptography.certificate.decryptMessage(result, clientEncryptionCert);



Encrypt Message (Certificate)

Encrypt a clear file to a cyphered file using a public key from a key container.


Technical Name Type Minimal Agent Version
certificate.encryptMessage synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
input string mandatory Input value.
certificate irpa_core.certificateContainer mandatory Certificate.
algorithm irpa_core.enums.cryptography.algorithmEncryption optional Encryption algorithm.

Output Parameters:

Name Type Description
encrypted string Encrypted value (null if failed).

Sample Code:

let clientEncryptionCert = { id: 'clientEncryptionCert', usage: irpa_core.enums.cryptography.usage.encryption, location: irpa_core.enums.cryptography.storeLocation.currentUser, store: 'My', alias: 'CN=irpa_coretClientExchange2' }; const result = await irpa_core.cryptography.certificate.encryptMessage('data',clientEncryptionCert);



Sign Encrypt Message (Certificate)

Sign and encrypt a message using a certificate or key container.


Technical Name Type Minimal Agent Version
certificate.signEncryptMessage synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
input string mandatory Input value.
certificate irpa_core.certificateContainer mandatory Certificate.
algorithm irpa_core.enums.cryptography.algorithmSignature optional Encryption algorithm.

Output Parameters:

Name Type Description
signedValue string Signed value (null if failed).

Sample Code:

let clientEncryptionCert = { id: 'clientEncryptionCert', usage: irpa_core.enums.cryptography.usage.encryption, location: irpa_core.enums.cryptography.storeLocation.currentUser, store: 'My', alias: 'CN=irpa_coretClientExchange2' }; let result = await irpa_core.cryptography.certificate.signEncryptMessage('data',clientEncryptionCert);



Sign Message (Certificate)

Sign a message using a certificate or key container.


Technical Name Type Minimal Agent Version
certificate.signMessage synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
input string mandatory Input value.
certificate irpa_core.certificateContainer mandatory Certificate.
algorithm irpa_core.enums.cryptography.algorithmSignature optional Encryption algorithm.

Output Parameters:

Name Type Description
signedvalue string Signed value (null if failed).

Sample Code:

let clientEncryptionCert = { id: 'clientEncryptionCert', usage: irpa_core.enums.cryptography.usage.signature, location: irpa_core.enums.cryptography.storeLocation.currentUser, store: 'My', alias: 'CN=irpa_coretClientSignature2' }; let result = await irpa_core.cryptography.certificate.signMessage('data',clientEncryptionCert);



Verify Decrypt Message (Certificate)

Verify and decrypt a signed message using a certificate or key container.


Technical Name Type Minimal Agent Version
certificate.verifyDecryptMessage synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
input string mandatory Input value.
certificate irpa_core.certificateContainer mandatory Certificate.
algorithm irpa_core.enums.cryptography.algorithmSignature optional Encryption algorithm.

Output Parameters:

Name Type Description
result string Clear value (null if failed).

Sample Code:

let clientEncryptionCert = { id: 'clientEncryptionCert', usage: irpa_core.enums.cryptography.usage.encryption, location: irpa_core.enums.cryptography.storeLocation.currentUser, store: 'My', alias: 'CN=irpa_coretClientExchange2' }; let result = await irpa_core.cryptography.certificate.signEncryptMessage('data',clientEncryptionCert); result = await irpa_core.cryptography.certificate.verifyDecryptMessage(result, clientEncryptionCert);



Verify Message (Certificate)

Verify a signed message using a certificate or key container.


Technical Name Type Minimal Agent Version
certificate.verifyMessage synchronous WIN-3.24

Input Parameters:

Name Type Attributes Default Description
input string mandatory Input value.
signature string mandatory Signature.
certificate irpa_core.certificateContainer mandatory Certificate.
algorithm irpa_core.enums.cryptography.algorithmSignature optional Encryption algorithm.

Output Parameters:

Name Type Description
result boolean Verification result (false if verification failed).

Sample Code:

let clientEncryptionCert = { id: 'clientEncryptionCert', usage: irpa_core.enums.cryptography.usage.encryption, location: irpa_core.enums.cryptography.storeLocation.currentUser, store: 'My', alias: 'CN=irpa_coretClientSignature2' }; let result = await irpa_core.cryptography.certificate.signMessage('data',clientEncryptionCert); result = await irpa_core.cryptography.certificate.verifyMessage('data', result, clientEncryptionCert);