I have a private key in the following format,
-----BEGIN PRIVATE KEY----- MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQCp1cSazYun0pCX . . T0r1PTCefoaLDO7gvwJ1Aa6rmF8SrA== -----END PRIVATE KEY----- I am trying to use this key to create a testnet client,
const operatorIdStr = await getAddress(); const operatorKeyStr = readFileSync(SECRET_KEY_PATH, "utf8"); const operatorId = AccountId.fromString(operatorIdStr); const operatorKey = await PrivateKey.fromPem(operatorKeyStr); client = await Client.forTestnet().setOperator(operatorId, operatorKey); I am getting following error message, BadKeyError: invalid private key length: 2358 bytes
Please note that I am trying to integrate with Fireblocks and private key is generated by Fireblocks at the time of wallet creation. Using openssl command the key length I see is Private-Key: (4096 bit, 2 primes)
Is this the right approach? Is there a sample code available to use a RSA key?
I tried converting the key to DER format using openssl, and tested with PrivateKey.fromStringDerPem(operatorKeyStr) but that did not help.
awaitinconst operatorKey = await PrivateKey ...?