Hierarchy

  • Rsa

Properties

Constructors

Properties

encrypt: ((params: { plainText: string; key: string; cipherType?: string }) => string)

Type declaration

    • (params: { plainText: string; key: string; cipherType?: string }): string
    • Used to encrypt the provided content with given public key.

      Method

      encrypt

      Returns

      Encrypted text which encoded with Base64

      Ios

      Android

      Since

      4.4

      Parameters

      • params: { plainText: string; key: string; cipherType?: string }
        • plainText: string

          Text to encrypt

        • key: string

          Public key in base64

        • Optional cipherType?: string

      Returns string

decrypt: ((params: { encryptedText: string; key: string; cipherType?: string }) => string)

Type declaration

    • (params: { encryptedText: string; key: string; cipherType?: string }): string
    • Used to decrypt the provided encrypted content with given private key.

      Method

      decrypt

      Returns

      Decrypted text

      Ios

      Android

      Since

      4.4

      Parameters

      • params: { encryptedText: string; key: string; cipherType?: string }
        • encryptedText: string

          Encrypted text to decrypt. Encoded with Base64.

        • key: string

          Private key in base64

        • Optional cipherType?: string

      Returns string

generateKeyPair: ((params: { keySize: number }) => { privateKey: string; publicKey: string })

Type declaration

    • (params: { keySize: number }): { privateKey: string; publicKey: string }
    • Generates RSA private and public key.

      Method

      generateKeyPair

      Returns

      returns private/public key

      Ios

      Android

      Since

      4.4

      Parameters

      • params: { keySize: number }
        • keySize: number

          Length of the key

      Returns { privateKey: string; publicKey: string }

      • privateKey: string
      • publicKey: string
ios: { getExportedPublicKey: ((key: string) => string) }

Type declaration

  • getExportedPublicKey: ((key: string) => string)
      • (key: string): string
      • On iOS, instead of using getBase64PublicString to retrieve generated public key, using this will yield better result.

        Ios

        Parameters

        • key: string

          RSA public key

        Returns string

Constructors

  • Returns Rsa

Generated using TypeDoc