minigame-std
    Preparing search index...

    Interface RSAPublicKey

    RSA 公钥接口,用于加密数据。

    1.6.0

    import { cryptos } from 'minigame-std';

    const publicKey = (await cryptos.rsa.importPublicKey(pemString, 'SHA-256')).unwrap();

    // 加密并返回 ArrayBuffer
    const encrypted = (await publicKey.encrypt('Hello, World!')).unwrap();

    // 加密并返回 Base64 字符串
    const encryptedStr = (await publicKey.encryptToString('Hello, World!')).unwrap();
    interface RSAPublicKey {
        encrypt(data: DataSource): AsyncIOResult<ArrayBuffer>;
        encryptToString(data: DataSource): AsyncIOResult<string>;
    }
    Index

    Methods