[Google Cloud Storage] Object reference not set to an instance of an object. in GoogleAPIToken
Forge component by Pedro Coelho
Application Type
Service Studio Version
11.11.4 (Build 43498)

Hello Internet

I've been trying to connect my Google Cloud Storage with the component and can't get it working. On the Google side, we have already set up everything (account, storage, bucket, service user, access certificates, etc.). For this purpose, there is a Forge component that I have been working on intensively over the last few days.
Unfortunately, I have not been able to get it to work. Therefore, after I started to doubt myself, I installed the demo of the Forge component and stored the access data via the site properties. Here I get the same error:  

Extension method

Object reference not set to an instance of an object.

eSpaceVer: Id=1777, PubId=0, CompiledWith=
RequestUrl: https://personal-wlfdncte.outsystemscloud.com/GoogleCloudStorageDemo/Upload.aspx (Method: POST)
AppDomain: /LM/W3SVC/6/ROOT/GoogleCloudStorageDemo-148-132679923874453488
FilePath: C:\OutSystems\Sandboxes\FCCDEQ003\Platform Server\running\GoogleCloudStorageDemo\Upload.aspx
ClientIp: 178.197.xxx.xxx
Locale: en-US
DateFormat: dd-MM-yyyy
PID: 4932 ('w3wp', Started='6/8/2021 4:54:29 PM', Priv=858Mb, Virt=2116564Mb)
TID: 38
Thread Name:
.NET: 4.0.30319.42000

Object reference not set to an instance of an object.
at Org.BouncyCastle.Crypto.Signers.RsaDigestSigner.Init(Boolean forSigning, ICipherParameters parameters)
at OutSystems.NssGoogleAPIToken.CssGoogleAPIToken.GetRS256Signature(Byte[] ssContent, String ssPrivateKey)
at OutSystems.NssGoogleAPIToken.CssGoogleAPIToken.MssGetToken(RCClientRecord ssClient, Int32 ssTokenLifespan, String ssScope, RCTokenRecord& ssToken)
at ssGoogleCloudStorage.RssExtensionGoogleAPIToken.MssGetToken(HeContext heContext, IRecord inParamClient, Int32 inParamTokenLifespan, String inParamScope, IRecord& outParamToken)

As I interpret the error message, the error does not appear directly in this forge component but is triggered by the GoogleAPIToken forge component.

Unfortunately, I do not see myself in a position to fix the error.  It would be great if you could take a look at it. 

Possible source of error could by me using open SSL wrong to convert the access certificate from Google in the PK12 format to the PEM format.

Also i found this atricle which doesnt solve my problem:  https://www.outsystems.com/forums/discussion/56542/object-reference-not-set-to-an-instance-of-an-object/



It was my error. I forgot to delete the cetificate information before the -----BEGIN PRIVATE KEY-- 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.