verifySignature method

bool verifySignature([
  1. EvpPkey? key
])

Verifies the CSR signature.

With no key this checks the self-signature — the proof that whoever sent the CSR holds the private key for the public key inside it, which is what a CA checks before issuing. Pass key to verify against a different public key instead.

Implementation

bool verifySignature([EvpPkey? key]) {
  final ownKey = key == null ? publicKey : null;
  try {
    final verifyKey = key ?? ownKey!;
    return _context.bindings.X509_REQ_verify(handle, verifyKey.handle) == 1;
  } finally {
    ownKey?.dispose();
  }
}