The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
36 views

How to create a signature using crypto class

The method signature must be generated by taking the query string, and creating a HMAC-SHA256 signature using your API key as the secret key. salesforce way of generating signature String ...
2
votes
1answer
36 views

Reducing the encrypted data field length size in salesforce

I am working on simple encryption using the crypto class to encrypt some data fields in salesforce. The encryption class works fine for text data with max size 255. however i need to reduce the ...
0
votes
1answer
412 views

How to decrypt AES-256 in node.js

I'm struggling to decode a piece of AES-256 encrypted base64 coded data in node.js. The data was encoded in Salesforce. I tried various different aes algorithms but without luck. I'm crypting and ...
1
vote
2answers
42 views

Using Crypt library in salesforce

I want the equivalent apex code for below PHP: crypt($timestamp.$username.$email,$secret_salt)
1
vote
1answer
108 views

Issue in generating Digest for SHA256

I have an API Integration which expects a SHA256/HMAC message digest encoded Signature. It also provides an example that if message body = 'testmessage' secret key = '123456789' Signature: ...
0
votes
1answer
28 views

AES decyption with PKCS7 Padding?

I have encrypted some Text in Java using PKCS7. In the Crypto class it is written that PKCS5 is supported, but is there any possibility using PKCS7? Or do you know a possibility that it would work ...
1
vote
0answers
27 views

PGP with asymmetric key in salesforce?

Can we perform asymmetric key cryptography with sign in salesforce? If yes, then how. If not, then what is the use of Crypto.sign(...) method. Please advice.
0
votes
1answer
89 views

How to use Crypto.signWithCertificate in apex?

I have a scenario where I need to create a static csv file resource signed with certificate. I have worked successfully with encryption and decryption but now client wants to sign it with ...
2
votes
0answers
52 views

Should we give the guest user profile the “view encrypted data” permission?

We've developed native VF/Apex code that allows us to send a link to a customer and have them securely view a PDF of their contract (contract is a VF page generated using data from fields in their ...
6
votes
1answer
628 views

Has anyone got the OAuth 2.0 JWT Bearer Token Flow to work initiated from Apex code now 'RSA-SHA256' signing is available?

This year old thread Connect apex and Google API using JWT to retrieve Oauth 2.0 token was started before the Crypto class included the 'RSA-SHA256' signing algorithm. Now that this algorithm is ...
2
votes
2answers
332 views

Securely Storing a static API secret/key in a Salesforce app

I recently submitted an application to the AppExchange, only to have it not pass the security check due to "Insecure Storage of Sensitive Data Vulnerability." The problem is that my app accesses an ...
1
vote
0answers
101 views

Decode Signature

I've one signature field containing encoded values like 'iVBORw0KGgoAAAANSUhEUgAAApAAAACNCAYAAAAAYko8AAAAHGlET1QAAAACAAAAAA...' and i want to restore it back and put them into a list and display the ...
2
votes
0answers
127 views

Decrypt base64 signature

I have to decode a long Signature field value to generate signature image. Please find code below. Can someone help me here? public class AccountPDF111 { Public void AccountPDF111(){} Public ...
3
votes
1answer
29 views

Any work-around for the lack of XMLSignature implementations?

As explained in this unimplemented for 4 years idea, Apex does not expose any XMLSignature implementations that could be used for example to validate the X509 signature on some XML. So: Does Apex ...
3
votes
0answers
102 views

Store Private/Public Key pair in a Custom Setting

I'm creating a digital signature for an integration and I've created a private/public key pair to sign the message. According to the Apex Crypto Class documentation, This private key should not ...
3
votes
1answer
440 views

Storing hash values (blob) in a string field?

I could sit and mess around with this but I really don't know the finer points of how cryptography works in Java/Apex to risk sitting on a security hole. Basically I'm creating a hash and then ...
4
votes
1answer
127 views

How to store a private key in a protected custom setting for use in Crypto class?

The Salesforce crypto class documentation specifies that a private key should be stored as a protected custom setting. "A PKCS8 formatted private key in base64 decoded form is required. This private ...
1
vote
0answers
85 views

Two-Way SSL Connection

I need to make a 2-way SSL connection to a particular service. In addition, the password for the service is a cryptographically signed long of the current datetime. In Salesforce, I can create a ...
0
votes
0answers
700 views

Input length must be multiple of 16 when decrypting with padded cipher

I am trying to get connect with FB. For that i have installed the FB tool provided by saleforce and working on it. When the code try to decryptWithManagedIV i am getting error Input length must be ...
1
vote
1answer
477 views

Invalid private key. Must be 32 bytes

I am trying to get connect with FB. For that i have installed the FB tool provided by saleforce and working on it. When the code try to decryptWithManagedIV i am getting error Invalid private ...
5
votes
2answers
4k views

How to encrypt and decrypt a String in Apex using the Crypto class

Please provide apex code examples to encrypt and decrypt a string using all of the supported encryption algorithms (AES128, AES192, and AES256). I searched for clear and concise code examples on this ...
5
votes
2answers
182 views

Workaround for AES decryption limit of 1 MB

We ran into the problem that obviously only 1 million byte (or 1MB) may be passed into the decrypt function. Does anybody know a workaround for this problem? There are JavaScript frameworks but they ...
5
votes
2answers
664 views

Verifying a signature in Apex

The apex crypto class is great but it appears to only be able to sign content. Is there any way to verify a signature in apex? I would expect a Crypto.verify() method but it doesn't appear to exist. I ...
6
votes
2answers
1k views

Connect apex and Google API using JWT to retrieve Oauth 2.0 token

I have been trying to connect Salesforce and Google API using server to server application. Intent :- To communicate data between Salesforce and Google Spreadsheet which is hosted in Google Sites ...
2
votes
1answer
897 views

Crypto Class & Private/Public Keys & Certificate

Has anyone used AES256 to encrypt and store Highly confidential data in force.com Database. What are the steps to follow? Help me with some insights into private/public keys and certificates, which of ...
2
votes
2answers
392 views

Salesforce OAuth and Client Network Configuration Changes

Can this be true that if we use Salesforce OAuth to grant login to a desktop app, then after validating and receiving tokens -> access, refresh etc) if client workstation switches Internet Connections ...
2
votes
1answer
995 views

Get first 16 Bytes from Blob object decoded from Base64

I have to call an external REST service and I have to decode the response. From external service documentation I think I have to decode the response with AES algorithm in this way: public static ...
3
votes
1answer
3k views

Why do I get 'PKIX path building failed' exception with my callout?

Error message :PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Hello all please see the above ...
1
vote
1answer
2k views

Oauth 1.0 oauth_signature generation and header creation for the authentication of external system

Can anybody help me with the oauth 1.0 oauth_signature generation from the client secret and consumer key? I have got client secret and consumer key along with the oauth token. Just need helping hand ...
4
votes
2answers
8k views

Sample Java class to decrypt AES128 encryption

Looking for some sample Java code that decrypts AES encrypted string. I'm trying to encrypt using Apex's Crypto class and decrypt using Java.
10
votes
1answer
1k views

Mimic MySQL AES_ENCRYPT in Apex

I am trying to mimic the MySQL AES_ENCRYPT function in Apex code. However the issue I am having is that MySQL doesn't use an initialization vector. Is there a way to replicate this behavior in Apex? ...