rsa-oaep-encryption
    Preparing search index...

    Interface RSAPublicKey

    RSA public key interface for encryption operations.

    const publicKey: RSAPublicKey = importPublicKey(pemString);
    const encrypted = publicKey.encrypt('Hello', sha256.create());
    interface RSAPublicKey {
        encrypt(data: string, hash: HashAlgorithm): ArrayBuffer;
    }
    Index

    Methods

    Methods

    • Encrypt data using RSA-OAEP algorithm.

      Parameters

      • data: string

        The string data to be encrypted.

      • hash: HashAlgorithm

        The hash algorithm instance to use (e.g., sha256.create()).

      Returns ArrayBuffer

      The encrypted data as an ArrayBuffer.

      const encrypted = publicKey.encrypt('sensitive data', sha256.create());