@phala/dstack-sdk
Version:
dstack SDK
19 lines • 1.02 kB
TypeScript
/**
* Verify the signature of a public key.
*
* @param publicKey - The public key bytes to verify (32 bytes)
* @param signature - The signature bytes (65 bytes)
* @param appId - The application ID
* @returns The compressed public key if valid, null otherwise
*
* @example
* ```typescript
* const publicKey = new Uint8Array(Buffer.from('e33a1832c6562067ff8f844a61e51ad051f1180b66ec2551fb0251735f3ee90a', 'hex'));
* const signature = new Uint8Array(Buffer.from('8542c49081fbf4e03f62034f13fbf70630bdf256a53032e38465a27c36fd6bed7a5e7111652004aef37f7fd92fbfc1285212c4ae6a6154203a48f5e16cad2cef00', 'hex'));
* const appId = '00'.repeat(20);
* const compressedPubkey = verifySignature(publicKey, signature, appId);
* console.log(compressedPubkey); // 0x0217610d74cbd39b6143842c6d8bc310d79da1d82cc9d17f8876376221eda0c38f
* ```
*/
export declare function verifyEnvEncryptPublicKey(publicKey: Uint8Array, signature: Uint8Array, appId: string): string | null;
//# sourceMappingURL=verify-env-encrypt-public-key.d.ts.map