/openssl_dart

An incomplete Dart wrapper for OpenSSL (libcrypto).

Primary LanguageDartMIT LicenseMIT

openssl_dart

codecov

An incomplete Dart wrapper for OpenSSL (libcrypto). The library is provided open source as-is.

Library structure

Each header is represented by a Dart file, with minimal work done to port it to classes, which keep track of the native handle.

Implemented headers

For each class provided, this library calls the respective _new function, as well as providing a dispose() method, which calls the respective _free function and sets the internal handle to null, making further calls invalid.

  • bio (provides BIO, BIOMethod)
    • BIO_f_base64
    • BIO_gets
    • BIO_new_mem_buf (via BIO.memory(data) constructor)
    • BIO_number_read
    • BIO_number_written
    • BIO_puts
    • BIO_read
    • BIO_s_mem
    • BIO_write
  • bn (provides BigNum)
    • BN_secure_new (via BigNum.secure() constructor)
    • BN_set_word
  • err (provides OpenSSLException)
    • ERR_error_string_n
    • ERR_func_error_string
    • ERR_get_error
    • ERR_lib_error_string
    • ERR_reason_error_string
  • evp (provides EVP and PKey)
    • EVP_Digest*
      • EVP_DigestSignFinal
      • EVP_DigestSignInit
      • EVP_DigestUpdate (macro implementation of EVP_DigestVerifyUpdate and EVP_DigestSignUpdate)
      • EVP_DigestVerifyFinal
      • EVP_DigestVerifyInit
    • EVP_PKEY_*
      • EVP_PKEY_assign
  • pem (provides readBioRSAPrivateKey, ...)
    • PEM_read_bio_RSAPrivateKey
    • PEM_read_bio_RSAPublicKey
    • PEM_write_bio_RSAPrivateKey
    • PEM_write_bio_RSAPublicKey
  • rsa (provides RSA)
    • RSA_bits
    • RSA_generate_key_ex
    • RSA_security_bits
    • RSA_sign
    • RSA_size
    • RSA_verify

Other source files

  • bindings.g.dart (contains native bindings generated by ffigen)
  • utils.dart (provides extensions for working with native calls)