Appearance
Privacy Services in SDK
To log into the Privacy Service and decrypt a string, follow these steps:
Log into the Privacy Service
- You can authenticate using either an API key or email and password.
- Example using API key:javascript
import { PrivacyService } from "skc-sdk"; const privacy = new PrivacyService("https://privacy.example.com"); await privacy.login({ apiKey: "your-api-key" });
- Example using email and password:javascript
import { PrivacyService } from "skc-sdk"; const privacy = new PrivacyService("https://privacy.example.com"); await privacy.login({ email: "your-email-id", password: "password" });
Decrypt a string
- Use the
decrypt
method of thePrivacyService
class. - Example:javascript
const decryptedText = await privacy.decrypt("cipherText", "assetId", "assetType");
By following these steps, you can log into the Privacy Service and decrypt a string.