Skip to main content
Error text formatting for readability
Source Link
Moonpie
  • 2.7k
  • 6
  • 15
  • 29

The public cert is issued by the claims provider. It is for custom apex JWT verification. I get an error when uploading: "Error: No certificate was imported because the keystore file doesn't contain a PrivateKey entry. Check the file and try again."

"Error: No certificate was imported because the keystore file doesn't contain a PrivateKey entry. Check the file and try again."

This works if I load the public key manually:

Blob publicKey = EncodingUtil.base64Decode('MIIBCg......');

//returns true    
System.debug(Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, publicKey));

I want to be able to use this way instead:

Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, '<cert name>'))

Folloing is the coomand to create the keystore:

keytool -importcert -file cert.cer -keystore cert.jks -alias stgcert -storetype jks

The public cert is issued by the claims provider. It is for custom apex JWT verification. I get an error when uploading: "Error: No certificate was imported because the keystore file doesn't contain a PrivateKey entry. Check the file and try again."

This works if I load the public key manually:

Blob publicKey = EncodingUtil.base64Decode('MIIBCg......');

//returns true    
System.debug(Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, publicKey));

I want to be able to use this way instead:

Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, '<cert name>'))

Folloing is the coomand to create the keystore:

keytool -importcert -file cert.cer -keystore cert.jks -alias stgcert -storetype jks

The public cert is issued by the claims provider. It is for custom apex JWT verification. I get an error when uploading:

"Error: No certificate was imported because the keystore file doesn't contain a PrivateKey entry. Check the file and try again."

This works if I load the public key manually:

Blob publicKey = EncodingUtil.base64Decode('MIIBCg......');

//returns true    
System.debug(Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, publicKey));

I want to be able to use this way instead:

Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, '<cert name>'))

Folloing is the coomand to create the keystore:

keytool -importcert -file cert.cer -keystore cert.jks -alias stgcert -storetype jks
Added keytool command.
Source Link
K A
  • 1
  • 2

The public cert is issued by the claims provider. It is for custom apex JWT verification. I get an error when uploading: "Error: No certificate was imported because the keystore file doesn't contain a PrivateKey entry. Check the file and try again."

This works if I load the public key manually:

Blob publicKey = EncodingUtil.base64Decode('MIIBCg......');

//returns true    
System.debug(Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, publicKey));

I want to be able to use this way instead:

Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, '<cert name>'))

Folloing is the coomand to create the keystore:

keytool -importcert -file cert.cer -keystore cert.jks -alias stgcert -storetype jks

The public cert is issued by the claims provider. It is for custom apex JWT verification. I get an error when uploading: "Error: No certificate was imported because the keystore file doesn't contain a PrivateKey entry. Check the file and try again."

This works if I load the public key manually:

Blob publicKey = EncodingUtil.base64Decode('MIIBCg......');

//returns true    
System.debug(Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, publicKey));

I want to be able to use this way instead:

Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, '<cert name>'))

The public cert is issued by the claims provider. It is for custom apex JWT verification. I get an error when uploading: "Error: No certificate was imported because the keystore file doesn't contain a PrivateKey entry. Check the file and try again."

This works if I load the public key manually:

Blob publicKey = EncodingUtil.base64Decode('MIIBCg......');

//returns true    
System.debug(Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, publicKey));

I want to be able to use this way instead:

Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, '<cert name>'))

Folloing is the coomand to create the keystore:

keytool -importcert -file cert.cer -keystore cert.jks -alias stgcert -storetype jks
added 7 characters in body
Source Link
K A
  • 1
  • 2

The public cert is issued by the claims provider. It is for custom apex JWT verification. I get an error when uploading: "Error: No certificate was imported because the keystore file doesn't contain a PrivateKey entry. Check the file and try again."

This works if I load the public key manually:

Blob publicKey = EncodingUtil.base64Decode('MIIBCg......');

//returns true    
System.debug(Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, publicKey)); //returns true

I want to be able to use this way instead:

Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, '<cert name>'))

The public cert is issued by the claims provider. It is for custom apex JWT verification. I get an error when uploading: "Error: No certificate was imported because the keystore file doesn't contain a PrivateKey entry. Check the file and try again."

This works if I load the public key manually:

Blob publicKey = EncodingUtil.base64Decode('MIIBCg......');

System.debug(Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, publicKey)); //returns true

I want to be able to use this way instead:

Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, '<cert name>'))

The public cert is issued by the claims provider. It is for custom apex JWT verification. I get an error when uploading: "Error: No certificate was imported because the keystore file doesn't contain a PrivateKey entry. Check the file and try again."

This works if I load the public key manually:

Blob publicKey = EncodingUtil.base64Decode('MIIBCg......');

//returns true    
System.debug(Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, publicKey));

I want to be able to use this way instead:

Crypto.verify('RSA-SHA256', Blob.valueOf(payload), bsignature, '<cert name>'))
added 47 characters in body
Source Link
K A
  • 1
  • 2
Loading
deleted 2 characters in body
Source Link
K A
  • 1
  • 2
Loading
Source Link
K A
  • 1
  • 2
Loading