Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
Don’t miss your chance to meet our SuiteGurus—NetSuite Support professionals and subject matter experts with extensive experience in select product areas, including OneWorld, Advanced & Basic Accounting, Supply Chain Management, Receivables & Payables, CRM, Account Administration, and the SuiteCloud Platform. Full Conference attendees can prebook exclusive 30-minute one-on-one sessions for your product questions.
Spots are limited! Register through your Agenda Builder and find SuiteGuru under Agenda Enhancements.
Convert Java code to Netsuite Script for Two factor Security Protocol Authentication for API Integra
We are trying to implement 2 factor authentication for third party REST API in Netsuite. I keep running into issues with AES decryption part. Please see the example of the code below in Java. I need to convert it into suitescript.
public static String decrypt(String encryptedData, String key) throws Exception
{
byte[] keyData = new byte[16];
System.arraycopy(key.getBytes(Charset.forName("UTF-8")), 0, keyData, 0, key.length());
Key secretKey = new SecretKeySpec(keyData, ALGO);
Cipher c = Cipher.getInstance(ALGO);
c.init(2, secretKey);
return new String(c.doFinal(Base64.decodeBase64(encryptedData)));
}
and this is the test data
decrypt("BjlDBJPu9VkmRJqOy5EgaA==","Test12");
/******challenge******/
BjlDBJPu9VkmRJqOy5EgaA==