PKCS7_sign function

  1. @RecordUse.new()
  2. @Native<Pointer<PKCS7> Function(Pointer<X509>, Pointer<EVP_PKEY>, Pointer<stack_st_X509>, Pointer<BIO>, Int)>(ffi.Pointer<X509>, ffi.Pointer<EVP_PKEY>, ffi.Pointer<stack_st_X509>, ffi.Pointer<BIO>, ffi.Int)>(symbol: 'bssl_dart_PKCS7_sign')
Pointer<PKCS7> PKCS7_sign(
  1. Pointer<X509> sign_cert,
  2. Pointer<EVP_PKEY> pkey,
  3. Pointer<stack_st_X509> certs,
  4. Pointer<BIO> data,
  5. int flags,
)

PKCS7_sign can operate in two modes to provide some backwards compatibility:

The first mode assembles certs into a PKCS#7 signed data ContentInfo with external data and no signatures. It returns a newly-allocated PKCS7 on success or NULL on error. sign_cert and pkey must be NULL. data is ignored. flags must be equal to PKCS7_DETACHED. Additionally, certificates in SignedData structures are unordered. The order of certs will not be preserved.

The second mode generates a detached RSA SHA-256 signature of data using pkey and produces a PKCS#7 SignedData structure containing it. certs must be NULL and flags must be exactly PKCS7_NOATTR | PKCS7_BINARY | PKCS7_NOCERTS | PKCS7_DETACHED.

Note this function only implements a subset of the corresponding OpenSSL function. It is provided for backwards compatibility only.

Implementation

@meta.RecordUse()
@ffi.Native<
  ffi.Pointer<PKCS7> Function(
    ffi.Pointer<X509>,
    ffi.Pointer<EVP_PKEY>,
    ffi.Pointer<stack_st_X509>,
    ffi.Pointer<BIO>,
    ffi.Int,
  )
>(symbol: 'bssl_dart_PKCS7_sign')
external ffi.Pointer<PKCS7> PKCS7_sign(
  ffi.Pointer<X509> sign_cert,
  ffi.Pointer<EVP_PKEY> pkey,
  ffi.Pointer<stack_st_X509> certs,
  ffi.Pointer<BIO> data,
  int flags,
);